Commit 68c2750e authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[csa] remove implicit conversions from TVariable to TNode

This avoids the ambiguous implicit conversion C++ compile
errors we had to fix with static_cast before.

Change-Id: I4247f617740f2b6d14d9588a902e0e25029a6726
Reviewed-on: https://chromium-review.googlesource.com/911629Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51217}
parent 488737d9
......@@ -1019,7 +1019,7 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) {
// the most generic implementation for the rest of the array.
BIND(&smi_transition);
{
Node* arg = args.AtIndex(arg_index);
Node* arg = args.AtIndex(arg_index.value());
GotoIf(TaggedIsSmi(arg), &default_label);
Node* length = LoadJSArrayLength(receiver);
// TODO(danno): Use the KeyedStoreGeneric stub here when possible,
......@@ -1066,7 +1066,7 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) {
// on the most generic implementation for the rest of the array.
BIND(&double_transition);
{
Node* arg = args.AtIndex(arg_index);
Node* arg = args.AtIndex(arg_index.value());
GotoIfNumber(arg, &default_label);
Node* length = LoadJSArrayLength(receiver);
// TODO(danno): Use the KeyedStoreGeneric stub here when possible,
......@@ -1094,7 +1094,7 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) {
CallRuntime(Runtime::kSetProperty, context, receiver, length, arg,
SmiConstant(LanguageMode::kStrict));
},
arg_index);
arg_index.value());
args.PopAndReturn(LoadJSArrayLength(receiver));
}
......@@ -1852,7 +1852,7 @@ class ArrayPopulatorAssembler : public CodeStubAssembler {
}
BIND(&done);
return array;
return array.value();
}
TNode<Object> ConstructArrayLike(TNode<Context> context,
......@@ -1913,7 +1913,7 @@ class ArrayPopulatorAssembler : public CodeStubAssembler {
}
BIND(&done);
return array;
return array.value();
}
void GenerateSetLength(TNode<Context> context, TNode<Object> array,
......@@ -2063,8 +2063,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
CSA_ASSERT(this, IsCallable(map_function));
Node* v = CallJS(CodeFactory::Call(isolate()), context, map_function,
this_arg, static_cast<Node*>(value),
static_cast<Node*>(index));
this_arg, value.value(), index.value());
GotoIfException(v, &on_exception, &var_exception);
value = CAST(v);
Goto(&next);
......@@ -2073,12 +2072,12 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
// Store the result in the output object (catching any exceptions so the
// iterator can be closed).
Node* define_status = CallRuntime(
Runtime::kCreateDataProperty, context, static_cast<Node*>(array),
static_cast<Node*>(index), static_cast<Node*>(value));
Node* define_status =
CallRuntime(Runtime::kCreateDataProperty, context, array.value(),
index.value(), value.value());
GotoIfException(define_status, &on_exception, &var_exception);
index = CAST(NumberInc(index));
index = CAST(NumberInc(index.value()));
// The spec requires that we throw an exception if index reaches 2^53-1,
// but an empty loop would take >100 days to do this many iterations. To
......@@ -2087,7 +2086,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
// e.g. a proxy that discarded the values. Ignoring this case just means
// we would repeatedly call CreateDataProperty with index = 2^53.
CSA_ASSERT_BRANCH(this, [&](Label* ok, Label* not_ok) {
BranchIfNumberRelationalComparison(Operation::kLessThan, index,
BranchIfNumberRelationalComparison(Operation::kLessThan, index.value(),
NumberConstant(kMaxSafeInteger), ok,
not_ok);
});
......@@ -2120,11 +2119,11 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
// Construct an array using the receiver as constructor with the same length
// as the input array.
array = ConstructArrayLike(context, args.GetReceiver(), length);
array = ConstructArrayLike(context, args.GetReceiver(), length.value());
TVARIABLE(Number, index, SmiConstant(0));
GotoIf(SmiEqual(length, SmiConstant(0)), &finished);
GotoIf(SmiEqual(length.value(), SmiConstant(0)), &finished);
// Loop from 0 to length-1.
{
......@@ -2133,7 +2132,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
BIND(&loop);
TVARIABLE(Object, value);
value = CAST(GetProperty(context, array_like, index));
value = CAST(GetProperty(context, array_like, index.value()));
// If a map_function is supplied then call it (using this_arg as
// receiver), on the value retrieved from the array.
......@@ -2143,27 +2142,25 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
CSA_ASSERT(this, IsCallable(map_function));
value = CAST(CallJS(CodeFactory::Call(isolate()), context, map_function,
this_arg, static_cast<Node*>(value),
static_cast<Node*>(index)));
this_arg, value.value(), index.value()));
Goto(&next);
BIND(&next);
}
// Store the result in the output object.
CallRuntime(Runtime::kCreateDataProperty, context,
static_cast<Node*>(array), static_cast<Node*>(index),
static_cast<Node*>(value));
index = CAST(NumberInc(index));
BranchIfNumberRelationalComparison(Operation::kLessThan, index, length,
&loop, &finished);
CallRuntime(Runtime::kCreateDataProperty, context, array.value(),
index.value(), value.value());
index = CAST(NumberInc(index.value()));
BranchIfNumberRelationalComparison(Operation::kLessThan, index.value(),
length.value(), &loop, &finished);
}
}
BIND(&finished);
// Finally set the length on the output and return it.
GenerateSetLength(context, array, length);
args.PopAndReturn(array);
GenerateSetLength(context, array.value(), length.value());
args.PopAndReturn(array.value());
}
// ES #sec-array.of
......
......@@ -144,8 +144,8 @@ void BaseCollectionsAssembler::AddConstructorEntry(
TVARIABLE(Object, value);
LoadKeyValue(context, key_value, &key, &value, if_may_have_side_effects,
if_exception, var_exception);
Node* key_n = key;
Node* value_n = value;
Node* key_n = key.value();
Node* value_n = value.value();
Node* ret = CallJS(CodeFactory::Call(isolate()), context, add_function,
collection, key_n, value_n);
GotoIfException(ret, if_exception, var_exception);
......@@ -164,7 +164,7 @@ void BaseCollectionsAssembler::AddConstructorEntries(
IsFastJSArrayWithNoCustomIteration(initial_entries, context,
native_context));
TNode<IntPtrT> at_least_space_for =
EstimatedInitialSize(initial_entries, use_fast_loop);
EstimatedInitialSize(initial_entries, use_fast_loop.value());
Label allocate_table(this, &use_fast_loop), exit(this), fast_loop(this),
slow_loop(this, Label::kDeferred);
Goto(&allocate_table);
......@@ -176,7 +176,7 @@ void BaseCollectionsAssembler::AddConstructorEntries(
GotoIfNot(
HasInitialCollectionPrototype(variant, native_context, collection),
&slow_loop);
Branch(use_fast_loop, &fast_loop, &slow_loop);
Branch(use_fast_loop.value(), &fast_loop, &slow_loop);
}
BIND(&fast_loop);
{
......@@ -515,7 +515,7 @@ TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedDoubleArrayElement(
Goto(&next);
}
BIND(&next);
return entry;
return entry.value();
}
void BaseCollectionsAssembler::LoadKeyValue(
......@@ -598,11 +598,11 @@ void BaseCollectionsAssembler::LoadKeyValue(
} else {
*key = UncheckedCast<Object>(GetProperty(
context, maybe_array, isolate()->factory()->zero_string()));
GotoIfException(*key, if_exception, var_exception);
GotoIfException(key->value(), if_exception, var_exception);
*value = UncheckedCast<Object>(GetProperty(
context, maybe_array, isolate()->factory()->one_string()));
GotoIfException(*value, if_exception, var_exception);
GotoIfException(value->value(), if_exception, var_exception);
Goto(&exit);
}
BIND(&if_notobject);
......@@ -2222,16 +2222,15 @@ TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndex(
BIND(&loop);
TNode<IntPtrT> key_index;
{
key_index = KeyIndexFromEntry(var_entry);
key_index = KeyIndexFromEntry(var_entry.value());
TNode<Object> entry_key = CAST(LoadFixedArrayElement(table, key_index));
key_compare(entry_key, &if_found);
// See HashTable::NextProbe().
Increment(&var_count);
var_entry = WordAnd(IntPtrAdd(UncheckedCast<IntPtrT>(var_entry),
UncheckedCast<IntPtrT>(var_count)),
entry_mask);
var_entry =
WordAnd(IntPtrAdd(var_entry.value(), var_count.value()), entry_mask);
Goto(&loop);
}
......@@ -2477,8 +2476,8 @@ TF_BUILTIN(WeakCollectionSet, WeakCollectionsBuiltinsAssembler) {
TNode<IntPtrT> entry_mask = EntryMask(capacity);
TVARIABLE(IntPtrT, var_hash, LoadJSReceiverIdentityHash(key, &if_no_hash));
TNode<IntPtrT> key_index =
FindKeyIndexForKey(table, key, var_hash, entry_mask, &if_not_found);
TNode<IntPtrT> key_index = FindKeyIndexForKey(table, key, var_hash.value(),
entry_mask, &if_not_found);
StoreFixedArrayElement(table, ValueIndexFromKeyIndex(key_index), value);
Return(collection);
......@@ -2500,14 +2499,14 @@ TF_BUILTIN(WeakCollectionSet, WeakCollectionsBuiltinsAssembler) {
&call_runtime);
TNode<IntPtrT> insertion_key_index =
FindKeyIndexForInsertion(table, var_hash, entry_mask);
FindKeyIndexForInsertion(table, var_hash.value(), entry_mask);
AddEntry(table, insertion_key_index, key, value, number_of_elements);
Return(collection);
}
BIND(&call_runtime);
{
CallRuntime(Runtime::kWeakCollectionSet, context, collection, key, value,
SmiTag(var_hash));
SmiTag(var_hash.value()));
Return(collection);
}
}
......
......@@ -863,9 +863,9 @@ TF_BUILTIN(RunMicrotasks, InternalBuiltinsAssembler) {
Goto(&loop);
BIND(&loop);
{
TNode<HeapObject> microtask =
TNode<HeapObject>::UncheckedCast(LoadFixedArrayElement(queue, index));
index = IntPtrAdd(index, IntPtrConstant(1));
TNode<HeapObject> microtask = TNode<HeapObject>::UncheckedCast(
LoadFixedArrayElement(queue, index.value()));
index = IntPtrAdd(index.value(), IntPtrConstant(1));
CSA_ASSERT(this, TaggedIsNotSmi(microtask));
......@@ -1050,7 +1050,7 @@ TF_BUILTIN(RunMicrotasks, InternalBuiltinsAssembler) {
}
BIND(&loop_next);
Branch(IntPtrLessThan(index, num_tasks), &loop, &init_queue_loop);
Branch(IntPtrLessThan(index.value(), num_tasks), &loop, &init_queue_loop);
}
}
}
......
......@@ -298,8 +298,8 @@ TNode<JSArray> ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
// Let desc be ? O.[[GetOwnProperty]](key).
TNode<DescriptorArray> descriptors = LoadMapDescriptors(map);
Label loop(this, 2, vars), after_loop(this), loop_condition(this);
Branch(IntPtrEqual(var_descriptor_number, object_enum_length), &after_loop,
&loop);
Branch(IntPtrEqual(var_descriptor_number.value(), object_enum_length),
&after_loop, &loop);
// We dont use BuildFastLoop.
// Instead, we use hand-written loop
......@@ -310,7 +310,7 @@ TNode<JSArray> ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
// so, map will not be changed.
CSA_ASSERT(this, WordEqual(map, LoadMap(object)));
TNode<Uint32T> descriptor_index = TNode<Uint32T>::UncheckedCast(
TruncateWordToWord32(var_descriptor_number));
TruncateWordToWord32(var_descriptor_number.value()));
Node* next_key = DescriptorArrayGetKey(descriptors, descriptor_index);
// Skip Symbols.
......@@ -330,7 +330,7 @@ TNode<JSArray> ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
VARIABLE(var_property_value, MachineRepresentation::kTagged,
UndefinedConstant());
Node* descriptor_name_index = DescriptorArrayToKeyIndex(
TruncateWordToWord32(var_descriptor_number));
TruncateWordToWord32(var_descriptor_number.value()));
// Let value be ? Get(O, key).
LoadPropertyFromFastObject(object, map, descriptors,
......@@ -352,20 +352,21 @@ TNode<JSArray> ObjectEntriesValuesBuiltinsAssembler::FastGetOwnValuesOrEntries(
value = array;
}
StoreFixedArrayElement(values_or_entries, var_result_index, value);
StoreFixedArrayElement(values_or_entries, var_result_index.value(),
value);
Increment(&var_result_index, 1);
Goto(&loop_condition);
BIND(&loop_condition);
{
Increment(&var_descriptor_number, 1);
Branch(IntPtrEqual(var_descriptor_number, object_enum_length),
Branch(IntPtrEqual(var_descriptor_number.value(), object_enum_length),
&after_loop, &loop);
}
}
BIND(&after_loop);
return FinalizeValuesOrEntriesJSArray(context, values_or_entries,
var_result_index, array_map,
var_result_index.value(), array_map,
if_no_properties);
}
}
......
......@@ -1063,13 +1063,13 @@ Node* RegExpBuiltinsAssembler::FlagsGetter(Node* const context,
Node* const flags_smi = LoadObjectField(regexp, JSRegExp::kFlagsOffset);
var_flags = SmiUntag(flags_smi);
#define CASE_FOR_FLAG(FLAG) \
do { \
Label next(this); \
GotoIfNot(IsSetWord(var_flags, FLAG), &next); \
var_length = SmiAdd(var_length, SmiConstant(1)); \
Goto(&next); \
BIND(&next); \
#define CASE_FOR_FLAG(FLAG) \
do { \
Label next(this); \
GotoIfNot(IsSetWord(var_flags.value(), FLAG), &next); \
var_length = SmiAdd(var_length.value(), SmiConstant(1)); \
Goto(&next); \
BIND(&next); \
} while (false)
CASE_FOR_FLAG(JSRegExp::kGlobal);
......@@ -1093,8 +1093,8 @@ Node* RegExpBuiltinsAssembler::FlagsGetter(Node* const context,
Label if_isflagset(this); \
BranchIfToBooleanIsTrue(flag, &if_isflagset, &next); \
BIND(&if_isflagset); \
var_length = SmiAdd(var_length, SmiConstant(1)); \
var_flags = Signed(WordOr(var_flags, IntPtrConstant(FLAG))); \
var_length = SmiAdd(var_length.value(), SmiConstant(1)); \
var_flags = Signed(WordOr(var_flags.value(), IntPtrConstant(FLAG))); \
Goto(&next); \
BIND(&next); \
} while (false)
......@@ -1112,7 +1112,7 @@ Node* RegExpBuiltinsAssembler::FlagsGetter(Node* const context,
// char for each set flag.
{
Node* const result = AllocateSeqOneByteString(context, var_length);
Node* const result = AllocateSeqOneByteString(context, var_length.value());
VARIABLE(var_offset, MachineType::PointerRepresentation(),
IntPtrConstant(SeqOneByteString::kHeaderSize - kHeapObjectTag));
......@@ -1120,7 +1120,7 @@ Node* RegExpBuiltinsAssembler::FlagsGetter(Node* const context,
#define CASE_FOR_FLAG(FLAG, CHAR) \
do { \
Label next(this); \
GotoIfNot(IsSetWord(var_flags, FLAG), &next); \
GotoIfNot(IsSetWord(var_flags.value(), FLAG), &next); \
Node* const value = Int32Constant(CHAR); \
StoreNoWriteBarrier(MachineRepresentation::kWord8, result, \
var_offset.value(), value); \
......@@ -2533,9 +2533,9 @@ Node* RegExpBuiltinsAssembler::ReplaceGlobalCallableFastPath(
Goto(&loop);
BIND(&loop);
{
GotoIfNot(IntPtrLessThan(var_i, end), &create_result);
GotoIfNot(IntPtrLessThan(var_i.value(), end), &create_result);
Node* const elem = LoadFixedArrayElement(res_elems, var_i);
Node* const elem = LoadFixedArrayElement(res_elems, var_i.value());
Label if_issmi(this), if_isstring(this), loop_epilogue(this);
Branch(TaggedIsSmi(elem), &if_issmi, &if_isstring);
......@@ -2559,9 +2559,10 @@ Node* RegExpBuiltinsAssembler::ReplaceGlobalCallableFastPath(
BIND(&if_isnegativeorzero);
{
var_i = IntPtrAdd(var_i, int_one);
var_i = IntPtrAdd(var_i.value(), int_one);
Node* const next_elem = LoadFixedArrayElement(res_elems, var_i);
Node* const next_elem =
LoadFixedArrayElement(res_elems, var_i.value());
var_match_start = SmiSub(next_elem, elem);
Goto(&loop_epilogue);
......@@ -2573,13 +2574,13 @@ Node* RegExpBuiltinsAssembler::ReplaceGlobalCallableFastPath(
CSA_ASSERT(this, IsString(elem));
Callable call_callable = CodeFactory::Call(isolate);
TNode<Smi> match_start = var_match_start;
TNode<Smi> match_start = var_match_start.value();
Node* const replacement_obj =
CallJS(call_callable, context, replace_callable, undefined, elem,
match_start, string);
Node* const replacement_str = ToString_Inline(context, replacement_obj);
StoreFixedArrayElement(res_elems, var_i, replacement_str);
StoreFixedArrayElement(res_elems, var_i.value(), replacement_str);
TNode<Smi> const elem_length = LoadStringLengthAsSmi(elem);
var_match_start = SmiAdd(match_start, elem_length);
......@@ -2589,7 +2590,7 @@ Node* RegExpBuiltinsAssembler::ReplaceGlobalCallableFastPath(
BIND(&loop_epilogue);
{
var_i = IntPtrAdd(var_i, int_one);
var_i = IntPtrAdd(var_i.value(), int_one);
Goto(&loop);
}
}
......
This diff is collapsed.
......@@ -42,7 +42,7 @@ TNode<Map> TypedArrayBuiltinsAssembler::LoadMapForType(
var_typed_map = HeapConstant(map);
});
return var_typed_map;
return var_typed_map.value();
}
// The byte_offset can be higher than Smi range, in which case to perform the
......@@ -279,7 +279,8 @@ TF_BUILTIN(TypedArrayInitialize, TypedArrayBuiltinsAssembler) {
BIND(&attach_buffer);
{
AttachBuffer(holder, var_buffer, fixed_typed_map, length, byte_offset);
AttachBuffer(holder, var_buffer.value(), fixed_typed_map, length,
byte_offset);
Goto(&done);
}
......@@ -502,10 +503,10 @@ void TypedArrayBuiltinsAssembler::ConstructByTypedArray(
BIND(&construct);
{
ConstructByArrayLike(context, holder, typed_array, source_length,
ConstructByArrayLike(context, holder, typed_array, source_length.value(),
element_size);
Node* proto =
GetProperty(context, buffer_constructor, PrototypeStringConstant());
Node* proto = GetProperty(context, buffer_constructor.value(),
PrototypeStringConstant());
// TODO(petermarshall): Correct for realm as per 9.1.14 step 4.
TNode<JSArrayBuffer> buffer = LoadObjectField<JSArrayBuffer>(
holder, JSArrayBufferView::kBufferOffset);
......@@ -548,7 +549,7 @@ TNode<BoolT> TypedArrayBuiltinsAssembler::ByteLengthIsValid(
Goto(&done);
BIND(&done);
return is_valid;
return is_valid.value();
}
void TypedArrayBuiltinsAssembler::ConstructByArrayLike(
......@@ -681,8 +682,8 @@ void TypedArrayBuiltinsAssembler::ConstructByIterable(
}
BIND(&done);
ConstructByArrayLike(context, holder, array_like, initial_length,
element_size);
ConstructByArrayLike(context, holder, array_like.value(),
initial_length.value(), element_size);
}
TF_BUILTIN(TypedArrayConstructor, TypedArrayBuiltinsAssembler) {
......@@ -850,7 +851,7 @@ TNode<IntPtrT> TypedArrayBuiltinsAssembler::GetTypedArrayElementSize(
element_size = IntPtrConstant(size);
});
return element_size;
return element_size.value();
}
TNode<Object> TypedArrayBuiltinsAssembler::GetDefaultConstructor(
......@@ -864,7 +865,7 @@ TNode<Object> TypedArrayBuiltinsAssembler::GetDefaultConstructor(
context_slot = IntPtrConstant(typed_array_function_index);
});
return LoadContextElement(LoadNativeContext(context), context_slot);
return LoadContextElement(LoadNativeContext(context), context_slot.value());
}
TNode<Object> TypedArrayBuiltinsAssembler::TypedArraySpeciesConstructor(
......@@ -887,7 +888,7 @@ TNode<Object> TypedArrayBuiltinsAssembler::TypedArraySpeciesConstructor(
Goto(&done);
BIND(&done);
return var_constructor;
return var_constructor.value();
}
TNode<JSTypedArray> TypedArrayBuiltinsAssembler::SpeciesCreateByArrayBuffer(
......@@ -961,7 +962,7 @@ TNode<JSArrayBuffer> TypedArrayBuiltinsAssembler::GetBuffer(
}
BIND(&done);
return CAST(var_result);
return CAST(var_result.value());
}
TNode<JSTypedArray> TypedArrayBuiltinsAssembler::ValidateTypedArray(
......@@ -1408,7 +1409,8 @@ TF_BUILTIN(TypedArrayPrototypeSubArray, TypedArrayBuiltinsAssembler) {
BIND(&offset_done);
// 11. Let newLength be max(endIndex - beginIndex, 0).
TNode<Smi> new_length = SmiMax(SmiSub(var_end, var_begin), SmiConstant(0));
TNode<Smi> new_length =
SmiMax(SmiSub(var_end.value(), var_begin.value()), SmiConstant(0));
// 12. Let constructorName be the String value of O.[[TypedArrayName]].
// 13. Let elementSize be the Number value of the Element Size value specified
......@@ -1421,7 +1423,7 @@ TF_BUILTIN(TypedArrayPrototypeSubArray, TypedArrayBuiltinsAssembler) {
LoadObjectField<Number>(source, JSTypedArray::kByteOffsetOffset);
// 15. Let beginByteOffset be srcByteOffset + beginIndex × elementSize.
TNode<Number> offset = SmiMul(var_begin, SmiFromWord(element_size));
TNode<Number> offset = SmiMul(var_begin.value(), SmiFromWord(element_size));
TNode<Number> begin_byte_offset = CAST(NumberAdd(source_byte_offset, offset));
// 16. Let argumentsList be « buffer, beginByteOffset, newLength ».
......
......@@ -10,8 +10,8 @@ namespace v8 {
namespace internal {
void GrowableFixedArray::Push(TNode<Object> const value) {
TNode<IntPtrT> const length = var_length_;
TNode<IntPtrT> const capacity = var_capacity_;
TNode<IntPtrT> const length = var_length_.value();
TNode<IntPtrT> const capacity = var_capacity_.value();
Label grow(this), store(this);
Branch(IntPtrEqual(capacity, length), &grow, &store);
......@@ -19,14 +19,14 @@ void GrowableFixedArray::Push(TNode<Object> const value) {
BIND(&grow);
{
var_capacity_ = NewCapacity(capacity);
var_array_ = ResizeFixedArray(length, var_capacity_);
var_array_ = ResizeFixedArray(length, var_capacity_.value());
Goto(&store);
}
BIND(&store);
{
TNode<FixedArray> const array = var_array_;
TNode<FixedArray> const array = var_array_.value();
StoreFixedArrayElement(array, length, value);
var_length_ = IntPtrAdd(length, IntPtrConstant(1));
......@@ -43,8 +43,8 @@ TNode<JSArray> GrowableFixedArray::ToJSArray(TNode<Context> const context) {
{
Label next(this);
TNode<IntPtrT> const length = var_length_;
TNode<IntPtrT> const capacity = var_capacity_;
TNode<IntPtrT> const length = var_length_.value();
TNode<IntPtrT> const capacity = var_capacity_.value();
GotoIf(WordEqual(length, capacity), &next);
......@@ -60,7 +60,7 @@ TNode<JSArray> GrowableFixedArray::ToJSArray(TNode<Context> const context) {
CAST(AllocateUninitializedJSArrayWithoutElements(array_map, result_length,
nullptr));
StoreObjectField(result, JSObject::kElementsOffset, var_array_);
StoreObjectField(result, JSObject::kElementsOffset, var_array_.value());
return result;
}
......@@ -86,7 +86,7 @@ TNode<FixedArray> GrowableFixedArray::ResizeFixedArray(
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(new_capacity, IntPtrConstant(0)));
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(new_capacity, element_count));
TNode<FixedArray> const from_array = var_array_;
TNode<FixedArray> const from_array = var_array_.value();
CodeStubAssembler::ExtractFixedArrayFlags flags;
flags |= CodeStubAssembler::ExtractFixedArrayFlag::kFixedArrays;
......
......@@ -26,7 +26,7 @@ class GrowableFixedArray : public CodeStubAssembler {
var_length_ = IntPtrConstant(0);
}
TNode<IntPtrT> length() const { return var_length_; }
TNode<IntPtrT> length() const { return var_length_.value(); }
TVariable<FixedArray>* var_array() { return &var_array_; }
TVariable<IntPtrT>* var_length() { return &var_length_; }
......
This diff is collapsed.
......@@ -1144,17 +1144,9 @@ class TypedCodeAssemblerVariable : public CodeAssemblerVariable {
initial_value) {}
#endif // DEBUG
template <class U, class = typename std::enable_if<
std::is_convertible<TNode<T>, TNode<U>>::value>::type>
operator TNode<U>() const {
return TNode<T>::UncheckedCast(value());
TNode<T> value() const {
return TNode<T>::UncheckedCast(CodeAssemblerVariable::value());
}
template <class U, class = typename std::enable_if<
std::is_convertible<TNode<T>, TNode<U>>::value>::type>
operator SloppyTNode<U>() const {
return value();
}
operator Node*() const { return value(); }
void operator=(TNode<T> value) { Bind(value); }
void operator=(const TypedCodeAssemblerVariable<T>& variable) {
......@@ -1163,7 +1155,6 @@ class TypedCodeAssemblerVariable : public CodeAssemblerVariable {
private:
using CodeAssemblerVariable::Bind;
using CodeAssemblerVariable::value;
};
class CodeAssemblerLabel {
......
......@@ -1894,7 +1894,7 @@ class AppendJSArrayCodeStubAssembler : public CodeStubAssembler {
Return(length);
BIND(&bailout);
Return(SmiTag(IntPtrAdd(arg_index, IntPtrConstant(2))));
Return(SmiTag(IntPtrAdd(arg_index.value(), IntPtrConstant(2))));
FunctionTester ft(csa_tester->GenerateCode(), kNumParams);
......
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