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);
}
}
......
......@@ -264,21 +264,23 @@ void StringBuiltinsAssembler::StringEqual_Loop(
{
// If {offset} equals {end}, no difference was found, so the
// strings are equal.
GotoIf(WordEqual(var_offset, length), if_equal);
GotoIf(WordEqual(var_offset.value(), length), if_equal);
// Load the next characters from {lhs} and {rhs}.
Node* lhs_value =
Load(lhs_type, lhs_data,
WordShl(var_offset, ElementSizeLog2Of(lhs_type.representation())));
WordShl(var_offset.value(),
ElementSizeLog2Of(lhs_type.representation())));
Node* rhs_value =
Load(rhs_type, rhs_data,
WordShl(var_offset, ElementSizeLog2Of(rhs_type.representation())));
WordShl(var_offset.value(),
ElementSizeLog2Of(rhs_type.representation())));
// Check if the characters match.
GotoIf(Word32NotEqual(lhs_value, rhs_value), if_not_equal);
// Advance to next character.
var_offset = IntPtrAdd(var_offset, IntPtrConstant(1));
var_offset = IntPtrAdd(var_offset.value(), IntPtrConstant(1));
Goto(&loop);
}
}
......@@ -372,13 +374,13 @@ void StringBuiltinsAssembler::GenerateStringRelationalComparison(Node* context,
{
// Check if {offset} equals {end}.
Label if_done(this), if_notdone(this);
Branch(WordEqual(var_offset, end), &if_done, &if_notdone);
Branch(WordEqual(var_offset.value(), end), &if_done, &if_notdone);
BIND(&if_notdone);
{
// Load the next characters from {lhs} and {rhs}.
Node* lhs_value = Load(MachineType::Uint8(), lhs, var_offset);
Node* rhs_value = Load(MachineType::Uint8(), rhs, var_offset);
Node* lhs_value = Load(MachineType::Uint8(), lhs, var_offset.value());
Node* rhs_value = Load(MachineType::Uint8(), rhs, var_offset.value());
// Check if the characters match.
Label if_valueissame(this), if_valueisnotsame(this);
......@@ -388,7 +390,7 @@ void StringBuiltinsAssembler::GenerateStringRelationalComparison(Node* context,
BIND(&if_valueissame);
{
// Advance to next character.
var_offset = IntPtrAdd(var_offset, IntPtrConstant(1));
var_offset = IntPtrAdd(var_offset.value(), IntPtrConstant(1));
}
Goto(&loop);
......@@ -613,11 +615,12 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
// The {code16} fits into the SeqOneByteString {one_byte_result}.
Node* offset = ElementOffsetFromIndex(
var_max_index, UINT8_ELEMENTS, CodeStubAssembler::INTPTR_PARAMETERS,
var_max_index.value(), UINT8_ELEMENTS,
CodeStubAssembler::INTPTR_PARAMETERS,
SeqOneByteString::kHeaderSize - kHeapObjectTag);
StoreNoWriteBarrier(MachineRepresentation::kWord8, one_byte_result,
offset, code16);
var_max_index = IntPtrAdd(var_max_index, IntPtrConstant(1));
var_max_index = IntPtrAdd(var_max_index.value(), IntPtrConstant(1));
});
arguments.PopAndReturn(one_byte_result);
......@@ -632,16 +635,17 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
// their corresponding positions in the new 16-bit string.
TNode<IntPtrT> zero = IntPtrConstant(0);
CopyStringCharacters(one_byte_result, two_byte_result, zero, zero,
var_max_index, String::ONE_BYTE_ENCODING,
var_max_index.value(), String::ONE_BYTE_ENCODING,
String::TWO_BYTE_ENCODING);
// Write the character that caused the 8-bit to 16-bit fault.
Node* max_index_offset = ElementOffsetFromIndex(
var_max_index, UINT16_ELEMENTS, CodeStubAssembler::INTPTR_PARAMETERS,
SeqTwoByteString::kHeaderSize - kHeapObjectTag);
Node* max_index_offset =
ElementOffsetFromIndex(var_max_index.value(), UINT16_ELEMENTS,
CodeStubAssembler::INTPTR_PARAMETERS,
SeqTwoByteString::kHeaderSize - kHeapObjectTag);
StoreNoWriteBarrier(MachineRepresentation::kWord16, two_byte_result,
max_index_offset, code16);
var_max_index = IntPtrAdd(var_max_index, IntPtrConstant(1));
var_max_index = IntPtrAdd(var_max_index.value(), IntPtrConstant(1));
// Resume copying the passed-in arguments from the same place where the
// 8-bit copy stopped, but this time copying over all of the characters
......@@ -654,14 +658,14 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
Word32And(code32, Int32Constant(String::kMaxUtf16CodeUnit));
Node* offset = ElementOffsetFromIndex(
var_max_index, UINT16_ELEMENTS,
var_max_index.value(), UINT16_ELEMENTS,
CodeStubAssembler::INTPTR_PARAMETERS,
SeqTwoByteString::kHeaderSize - kHeapObjectTag);
StoreNoWriteBarrier(MachineRepresentation::kWord16, two_byte_result,
offset, code16);
var_max_index = IntPtrAdd(var_max_index, IntPtrConstant(1));
var_max_index = IntPtrAdd(var_max_index.value(), IntPtrConstant(1));
},
var_max_index);
var_max_index.value());
arguments.PopAndReturn(two_byte_result);
}
......@@ -1553,14 +1557,15 @@ class StringPadAssembler : public StringBuiltinsAssembler {
GotoIf(IsUndefined(fill), &pad);
var_fill_string = ToString_Inline(context, fill);
var_fill_length = LoadStringLengthAsWord(var_fill_string);
var_fill_length = LoadStringLengthAsWord(var_fill_string.value());
Branch(IntPtrGreaterThan(var_fill_length, IntPtrConstant(0)), &pad,
&dont_pad);
Branch(IntPtrGreaterThan(var_fill_length.value(), IntPtrConstant(0)),
&pad, &dont_pad);
}
BIND(&pad);
{
CSA_ASSERT(this, IntPtrGreaterThan(var_fill_length, IntPtrConstant(0)));
CSA_ASSERT(this,
IntPtrGreaterThan(var_fill_length.value(), IntPtrConstant(0)));
CSA_ASSERT(this, SmiGreaterThan(max_length, string_length));
Callable stringadd_callable =
......@@ -1570,22 +1575,22 @@ class StringPadAssembler : public StringBuiltinsAssembler {
VARIABLE(var_pad, MachineRepresentation::kTagged);
Label single_char_fill(this), multi_char_fill(this), return_result(this);
Branch(IntPtrEqual(var_fill_length, IntPtrConstant(1)), &single_char_fill,
&multi_char_fill);
Branch(IntPtrEqual(var_fill_length.value(), IntPtrConstant(1)),
&single_char_fill, &multi_char_fill);
// Fast path for a single character fill. No need to calculate number of
// repetitions or remainder.
BIND(&single_char_fill);
{
var_pad.Bind(CallBuiltin(Builtins::kStringRepeat, context,
static_cast<Node*>(var_fill_string),
static_cast<Node*>(var_fill_string.value()),
pad_length));
Goto(&return_result);
}
BIND(&multi_char_fill);
{
TNode<Int32T> const fill_length_word32 =
TruncateWordToWord32(var_fill_length);
TruncateWordToWord32(var_fill_length.value());
TNode<Int32T> const pad_length_word32 = SmiToWord32(pad_length);
TNode<Int32T> const repetitions_word32 =
Int32Div(pad_length_word32, fill_length_word32);
......@@ -1593,15 +1598,14 @@ class StringPadAssembler : public StringBuiltinsAssembler {
Int32Mod(pad_length_word32, fill_length_word32);
var_pad.Bind(CallBuiltin(Builtins::kStringRepeat, context,
static_cast<Node*>(var_fill_string),
var_fill_string.value(),
SmiFromWord32(repetitions_word32)));
GotoIfNot(remaining_word32, &return_result);
{
Node* const remainder_string =
CallBuiltin(Builtins::kSubString, context,
static_cast<Node*>(var_fill_string), SmiConstant(0),
SmiFromWord32(remaining_word32));
Node* const remainder_string = CallBuiltin(
Builtins::kSubString, context, var_fill_string.value(),
SmiConstant(0), SmiFromWord32(remaining_word32));
var_pad.Bind(CallStub(stringadd_callable, context, var_pad.value(),
remainder_string));
Goto(&return_result);
......@@ -1682,9 +1686,11 @@ TF_BUILTIN(StringPrototypeSlice, StringBuiltinsAssembler) {
Label return_emptystring(this);
BIND(&out);
{
GotoIf(SmiLessThanOrEqual(var_end, var_start), &return_emptystring);
Node* const result = SubString(context, subject_string, var_start, var_end,
SubStringFlags::FROM_TO_ARE_BOUNDED);
GotoIf(SmiLessThanOrEqual(var_end.value(), var_start.value()),
&return_emptystring);
Node* const result =
SubString(context, subject_string, var_start.value(), var_end.value(),
SubStringFlags::FROM_TO_ARE_BOUNDED);
args.PopAndReturn(result);
}
......@@ -1841,16 +1847,16 @@ TF_BUILTIN(StringPrototypeSubstr, StringBuiltinsAssembler) {
TVARIABLE(Smi, var_result_length);
Branch(TaggedIsSmi(var_length), &if_issmi, &if_isheapnumber);
Branch(TaggedIsSmi(var_length.value()), &if_issmi, &if_isheapnumber);
// Set {length} to min(max({length}, 0), {string_length} - {start}
BIND(&if_issmi);
{
TNode<Smi> const positive_length = SmiMax(CAST(var_length), zero);
TNode<Smi> const minimal_length = SmiSub(string_length, var_start);
TNode<Smi> const positive_length = SmiMax(CAST(var_length.value()), zero);
TNode<Smi> const minimal_length = SmiSub(string_length, var_start.value());
var_result_length = SmiMin(positive_length, minimal_length);
GotoIfNot(SmiLessThanOrEqual(var_result_length, zero), &out);
GotoIfNot(SmiLessThanOrEqual(var_result_length.value(), zero), &out);
args.PopAndReturn(EmptyStringConstant());
}
......@@ -1860,11 +1866,12 @@ TF_BUILTIN(StringPrototypeSubstr, StringBuiltinsAssembler) {
// two cases according to the spec: if it is negative, "" is returned; if
// it is positive, then length is set to {string_length} - {start}.
CSA_ASSERT(this, IsHeapNumber(var_length));
CSA_ASSERT(this, IsHeapNumber(var_length.value()));
Label if_isnegative(this), if_ispositive(this);
TNode<Float64T> const float_zero = Float64Constant(0.);
TNode<Float64T> const length_float = LoadHeapNumberValue(CAST(var_length));
TNode<Float64T> const length_float =
LoadHeapNumberValue(CAST(var_length.value()));
Branch(Float64LessThan(length_float, float_zero), &if_isnegative,
&if_ispositive);
......@@ -1873,16 +1880,16 @@ TF_BUILTIN(StringPrototypeSubstr, StringBuiltinsAssembler) {
BIND(&if_ispositive);
{
var_result_length = SmiSub(string_length, var_start);
GotoIfNot(SmiLessThanOrEqual(var_result_length, zero), &out);
var_result_length = SmiSub(string_length, var_start.value());
GotoIfNot(SmiLessThanOrEqual(var_result_length.value(), zero), &out);
args.PopAndReturn(EmptyStringConstant());
}
}
BIND(&out);
{
TNode<Smi> const end = SmiAdd(var_start, var_result_length);
Node* const result = SubString(context, string, var_start, end);
TNode<Smi> const end = SmiAdd(var_start.value(), var_result_length.value());
Node* const result = SubString(context, string, var_start.value(), end);
args.PopAndReturn(result);
}
}
......@@ -1933,7 +1940,7 @@ TNode<Smi> StringBuiltinsAssembler::ToSmiBetweenZeroAnd(
}
BIND(&out);
return var_result;
return var_result.value();
}
TF_BUILTIN(SubString, CodeStubAssembler) {
......@@ -2050,9 +2057,10 @@ void StringTrimAssembler::Generate(String::TrimMode mode,
IntPtrConstant(-1), -1, &return_emptystring);
}
arguments.PopAndReturn(SubString(context, string, SmiTag(var_start),
SmiAdd(SmiTag(var_end), SmiConstant(1)),
SubStringFlags::FROM_TO_ARE_BOUNDED));
arguments.PopAndReturn(
SubString(context, string, SmiTag(var_start.value()),
SmiAdd(SmiTag(var_end.value()), SmiConstant(1)),
SubStringFlags::FROM_TO_ARE_BOUNDED));
BIND(&if_runtime);
arguments.PopAndReturn(
......@@ -2215,21 +2223,21 @@ TNode<Int32T> StringBuiltinsAssembler::LoadSurrogatePairAt(
var_result = StringCharCodeAt(string, index);
var_trail = Int32Constant(0);
GotoIf(Word32NotEqual(Word32And(var_result, Int32Constant(0xFC00)),
GotoIf(Word32NotEqual(Word32And(var_result.value(), Int32Constant(0xFC00)),
Int32Constant(0xD800)),
&return_result);
TNode<IntPtrT> next_index = IntPtrAdd(index, IntPtrConstant(1));
GotoIfNot(IntPtrLessThan(next_index, length), &return_result);
var_trail = StringCharCodeAt(string, next_index);
Branch(Word32Equal(Word32And(var_trail, Int32Constant(0xFC00)),
Branch(Word32Equal(Word32And(var_trail.value(), Int32Constant(0xFC00)),
Int32Constant(0xDC00)),
&handle_surrogate_pair, &return_result);
BIND(&handle_surrogate_pair);
{
TNode<Int32T> lead = var_result;
TNode<Int32T> trail = var_trail;
TNode<Int32T> lead = var_result.value();
TNode<Int32T> trail = var_trail.value();
// Check that this path is only taken if a surrogate pair is found
CSA_SLOW_ASSERT(this,
......@@ -2266,7 +2274,7 @@ TNode<Int32T> StringBuiltinsAssembler::LoadSurrogatePairAt(
}
BIND(&return_result);
return var_result;
return var_result.value();
}
// ES6 #sec-%stringiteratorprototype%.next
......
......@@ -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_; }
......
......@@ -651,8 +651,8 @@ TNode<Smi> CodeStubAssembler::ConvertToRelativeIndex(TNode<Context> context,
Goto(&done);
}
BIND(&done);
CSA_ASSERT(this, TaggedIsPositiveSmi(result));
return result;
CSA_ASSERT(this, TaggedIsPositiveSmi(result.value()));
return result.value();
}
Node* CodeStubAssembler::SmiMod(Node* a, Node* b) {
......@@ -776,7 +776,7 @@ TNode<Number> CodeStubAssembler::SmiMul(SloppyTNode<Smi> a,
}
BIND(&return_result);
return var_result;
return var_result.value();
}
Node* CodeStubAssembler::TrySmiDiv(Node* dividend, Node* divisor,
......@@ -943,7 +943,7 @@ TNode<BoolT> CodeStubAssembler::IsFastJSArray(SloppyTNode<Object> object,
Goto(&exit);
}
BIND(&exit);
return var_result;
return var_result.value();
}
TNode<BoolT> CodeStubAssembler::IsFastJSArrayWithNoCustomIteration(
......@@ -971,7 +971,7 @@ TNode<BoolT> CodeStubAssembler::IsFastJSArrayWithNoCustomIteration(
Goto(&exit);
}
BIND(&exit);
return var_result;
return var_result.value();
}
void CodeStubAssembler::BranchIfFastJSArray(Node* object, Node* context,
......@@ -1545,16 +1545,16 @@ TNode<Object> CodeStubAssembler::LoadMapConstructor(SloppyTNode<Map> map) {
Goto(&loop);
BIND(&loop);
{
GotoIf(TaggedIsSmi(result), &done);
GotoIf(TaggedIsSmi(result.value()), &done);
Node* is_map_type =
InstanceTypeEqual(LoadInstanceType(CAST(result)), MAP_TYPE);
InstanceTypeEqual(LoadInstanceType(CAST(result.value())), MAP_TYPE);
GotoIfNot(is_map_type, &done);
result =
LoadObjectField(CAST(result), Map::kConstructorOrBackPointerOffset);
result = LoadObjectField(CAST(result.value()),
Map::kConstructorOrBackPointerOffset);
Goto(&loop);
}
BIND(&done);
return result;
return result.value();
}
Node* CodeStubAssembler::LoadMapEnumLength(SloppyTNode<Map> map) {
......@@ -1620,11 +1620,11 @@ TNode<IntPtrT> CodeStubAssembler::LoadJSReceiverIdentityHash(
BIND(&done);
if (if_no_hash != nullptr) {
GotoIf(
IntPtrEqual(var_hash, IntPtrConstant(PropertyArray::kNoHashSentinel)),
if_no_hash);
GotoIf(IntPtrEqual(var_hash.value(),
IntPtrConstant(PropertyArray::kNoHashSentinel)),
if_no_hash);
}
return var_hash;
return var_hash.value();
}
TNode<Uint32T> CodeStubAssembler::LoadNameHashField(SloppyTNode<Name> name) {
......@@ -2128,7 +2128,7 @@ TNode<Smi> CodeStubAssembler::BuildAppendJSArray(ElementsKind kind,
VARIABLE(var_elements, MachineRepresentation::kTagged, LoadElements(array));
// Resize the capacity of the fixed array if it doesn't fit.
TNode<IntPtrT> first = *arg_index;
TNode<IntPtrT> first = arg_index->value();
Node* growth = WordToParameter(
IntPtrSub(UncheckedCast<IntPtrT>(args->GetLength(INTPTR_PARAMETERS)),
first),
......@@ -2161,12 +2161,12 @@ TNode<Smi> CodeStubAssembler::BuildAppendJSArray(ElementsKind kind,
var_tagged_length = length;
Node* diff = SmiSub(length, LoadFastJSArrayLength(array));
StoreObjectFieldNoWriteBarrier(array, JSArray::kLengthOffset, length);
*arg_index = IntPtrAdd(*arg_index, SmiUntag(diff));
*arg_index = IntPtrAdd(arg_index->value(), SmiUntag(diff));
Goto(bailout);
}
BIND(&success);
return var_tagged_length;
return var_tagged_length.value();
}
void CodeStubAssembler::TryStoreArrayElement(ElementsKind kind,
......@@ -3804,7 +3804,7 @@ TNode<Number> CodeStubAssembler::ChangeFloat64ToTagged(
Goto(&if_join);
}
BIND(&if_join);
return var_result;
return var_result.value();
}
TNode<Number> CodeStubAssembler::ChangeInt32ToTagged(
......@@ -3833,7 +3833,7 @@ TNode<Number> CodeStubAssembler::ChangeInt32ToTagged(
}
Goto(&if_join);
BIND(&if_join);
return var_result;
return var_result.value();
}
TNode<Number> CodeStubAssembler::ChangeUint32ToTagged(
......@@ -3874,7 +3874,7 @@ TNode<Number> CodeStubAssembler::ChangeUint32ToTagged(
Goto(&if_join);
BIND(&if_join);
return var_result;
return var_result.value();
}
TNode<String> CodeStubAssembler::ToThisString(Node* context, Node* value,
......@@ -3939,7 +3939,7 @@ TNode<Float64T> CodeStubAssembler::ChangeNumberToFloat64(
}
BIND(&done);
return result;
return result.value();
}
TNode<UintPtrT> CodeStubAssembler::ChangeNonnegativeNumberToUintPtr(
......@@ -3959,7 +3959,7 @@ TNode<UintPtrT> CodeStubAssembler::ChangeNonnegativeNumberToUintPtr(
Goto(&done);
BIND(&done);
return result;
return result.value();
}
Node* CodeStubAssembler::TimesPointerSize(Node* value) {
......@@ -4702,7 +4702,7 @@ TNode<Int32T> CodeStubAssembler::StringCharCodeAt(SloppyTNode<String> string,
}
BIND(&return_result);
return var_result;
return var_result.value();
}
TNode<String> CodeStubAssembler::StringFromCharCode(TNode<Int32T> code) {
......@@ -5368,7 +5368,7 @@ TNode<Number> CodeStubAssembler::StringToNumber(SloppyTNode<String> input) {
}
BIND(&end);
return var_result;
return var_result.value();
}
Node* CodeStubAssembler::NumberToString(Node* argument) {
......@@ -5644,7 +5644,7 @@ TNode<Number> CodeStubAssembler::ToNumber_Inline(SloppyTNode<Context> context,
}
BIND(&end);
return var_result;
return var_result.value();
}
TNode<Number> CodeStubAssembler::ToNumber(SloppyTNode<Context> context,
......@@ -5677,7 +5677,7 @@ TNode<Number> CodeStubAssembler::ToNumber(SloppyTNode<Context> context,
}
BIND(&end);
return var_result;
return var_result.value();
}
void CodeStubAssembler::TaggedToNumeric(Node* context, Node* value, Label* done,
......@@ -5997,7 +5997,7 @@ TNode<Number> CodeStubAssembler::ToInteger(SloppyTNode<Context> context,
Label return_zero(this, Label::kDeferred);
// Load the current {arg} value.
TNode<Object> arg = var_arg;
TNode<Object> arg = var_arg.value();
// Check if {arg} is a Smi.
GotoIf(TaggedIsSmi(arg), &out);
......@@ -6042,8 +6042,9 @@ TNode<Number> CodeStubAssembler::ToInteger(SloppyTNode<Context> context,
}
BIND(&out);
if (mode == kTruncateMinusZero) CSA_ASSERT(this, IsNumberNormalized(var_arg));
return CAST(var_arg);
if (mode == kTruncateMinusZero)
CSA_ASSERT(this, IsNumberNormalized(var_arg.value()));
return CAST(var_arg.value());
}
TNode<Uint32T> CodeStubAssembler::DecodeWord32(SloppyTNode<Word32T> word32,
......@@ -8425,19 +8426,22 @@ void CodeStubAssembler::BranchIfNumberRelationalComparison(
{
switch (op) {
case Operation::kLessThan:
Branch(Float64LessThan(var_left_float, var_right_float), if_true,
if_false);
Branch(Float64LessThan(var_left_float.value(), var_right_float.value()),
if_true, if_false);
break;
case Operation::kLessThanOrEqual:
Branch(Float64LessThanOrEqual(var_left_float, var_right_float), if_true,
if_false);
Branch(Float64LessThanOrEqual(var_left_float.value(),
var_right_float.value()),
if_true, if_false);
break;
case Operation::kGreaterThan:
Branch(Float64GreaterThan(var_left_float, var_right_float), if_true,
if_false);
Branch(
Float64GreaterThan(var_left_float.value(), var_right_float.value()),
if_true, if_false);
break;
case Operation::kGreaterThanOrEqual:
Branch(Float64GreaterThanOrEqual(var_left_float, var_right_float),
Branch(Float64GreaterThanOrEqual(var_left_float.value(),
var_right_float.value()),
if_true, if_false);
break;
default:
......@@ -8831,19 +8835,22 @@ Node* CodeStubAssembler::RelationalComparison(Operation op, Node* left,
{
switch (op) {
case Operation::kLessThan:
Branch(Float64LessThan(var_left_float, var_right_float), &return_true,
&return_false);
Branch(Float64LessThan(var_left_float.value(), var_right_float.value()),
&return_true, &return_false);
break;
case Operation::kLessThanOrEqual:
Branch(Float64LessThanOrEqual(var_left_float, var_right_float),
Branch(Float64LessThanOrEqual(var_left_float.value(),
var_right_float.value()),
&return_true, &return_false);
break;
case Operation::kGreaterThan:
Branch(Float64GreaterThan(var_left_float, var_right_float),
&return_true, &return_false);
Branch(
Float64GreaterThan(var_left_float.value(), var_right_float.value()),
&return_true, &return_false);
break;
case Operation::kGreaterThanOrEqual:
Branch(Float64GreaterThanOrEqual(var_left_float, var_right_float),
Branch(Float64GreaterThanOrEqual(var_left_float.value(),
var_right_float.value()),
&return_true, &return_false);
break;
default:
......@@ -8864,7 +8871,7 @@ Node* CodeStubAssembler::RelationalComparison(Operation op, Node* left,
}
BIND(&end);
return var_result;
return var_result.value();
}
Node* CodeStubAssembler::CollectFeedbackForString(Node* instance_type) {
......@@ -9272,8 +9279,8 @@ Node* CodeStubAssembler::Equal(Node* left, Node* right, Node* context,
BIND(&do_float_comparison);
{
Branch(Float64Equal(var_left_float, var_right_float), &if_equal,
&if_notequal);
Branch(Float64Equal(var_left_float.value(), var_right_float.value()),
&if_equal, &if_notequal);
}
BIND(&if_equal);
......@@ -9803,8 +9810,8 @@ TNode<Oddball> CodeStubAssembler::HasProperty(SloppyTNode<HeapObject> object,
}
BIND(&end);
CSA_ASSERT(this, IsBoolean(result));
return result;
CSA_ASSERT(this, IsBoolean(result.value()));
return result.value();
}
Node* CodeStubAssembler::ClassOf(Node* value) {
......@@ -10637,7 +10644,7 @@ TNode<Object> CodeStubArguments::GetOptionalArgumentValue(
assembler_->Goto(&argument_done);
assembler_->BIND(&argument_done);
return result;
return result.value();
}
void CodeStubArguments::ForEach(
......
......@@ -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