Index: src/code-stub-assembler.cc |
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc |
index b1581b2b08674401e902a1f6f33768af779ff902..edfe2de86c1c0c00140ce58d81a4395bd6ef3167 100644 |
--- a/src/code-stub-assembler.cc |
+++ b/src/code-stub-assembler.cc |
@@ -74,8 +74,9 @@ |
} else { |
SNPrintF(buffer, "CSA_ASSERT failed: %s\n", message); |
} |
- CallRuntime(Runtime::kGlobalPrint, SmiConstant(0), |
- HeapConstant(factory()->InternalizeUtf8String(&(buffer[0])))); |
+ CallRuntime( |
+ Runtime::kGlobalPrint, SmiConstant(Smi::kZero), |
+ HeapConstant(factory()->NewStringFromAsciiChecked(&(buffer[0])))); |
} |
DebugBreak(); |
Goto(&ok); |
@@ -195,10 +196,6 @@ |
value = WordOr(value, WordShr(value, IntPtrConstant(i))); |
} |
return IntPtrAdd(value, IntPtrConstant(1)); |
-} |
- |
-Node* CodeStubAssembler::MatchesParameterMode(Node* value, ParameterMode mode) { |
- return (mode == SMI_PARAMETERS) ? TaggedIsSmi(value) : Int32Constant(1); |
} |
Node* CodeStubAssembler::WordIsPowerOfTwo(Node* value) { |
@@ -675,7 +672,6 @@ |
void CodeStubAssembler::BranchIfPrototypesHaveNoElements( |
Node* receiver_map, Label* definitely_no_elements, |
Label* possibly_elements) { |
- CSA_SLOW_ASSERT(this, IsMap(receiver_map)); |
VARIABLE(var_map, MachineRepresentation::kTagged, receiver_map); |
Label loop_body(this, &var_map); |
Node* empty_elements = LoadRoot(Heap::kEmptyFixedArrayRootIndex); |
@@ -1216,7 +1212,6 @@ |
Node* CodeStubAssembler::LoadSharedFunctionInfoSpecialField( |
Node* shared, int offset, ParameterMode mode) { |
- CSA_SLOW_ASSERT(this, HasInstanceType(shared, SHARED_FUNCTION_INFO_TYPE)); |
if (Is64()) { |
Node* result = LoadObjectField(shared, offset, MachineType::Int32()); |
if (mode == SMI_PARAMETERS) { |
@@ -1361,8 +1356,6 @@ |
Node* CodeStubAssembler::LoadAndUntagToWord32FixedArrayElement( |
Node* object, Node* index_node, int additional_offset, |
ParameterMode parameter_mode) { |
- CSA_SLOW_ASSERT(this, IsFixedArray(object)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode)); |
int32_t header_size = |
FixedArray::kHeaderSize + additional_offset - kHeapObjectTag; |
#if V8_TARGET_LITTLE_ENDIAN |
@@ -1382,8 +1375,6 @@ |
Node* CodeStubAssembler::LoadFixedDoubleArrayElement( |
Node* object, Node* index_node, MachineType machine_type, |
int additional_offset, ParameterMode parameter_mode, Label* if_hole) { |
- CSA_SLOW_ASSERT(this, IsFixedDoubleArray(object)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode)); |
CSA_ASSERT(this, IsFixedDoubleArray(object)); |
int32_t header_size = |
FixedDoubleArray::kHeaderSize + additional_offset - kHeapObjectTag; |
@@ -1551,8 +1542,6 @@ |
WriteBarrierMode barrier_mode, |
int additional_offset, |
ParameterMode parameter_mode) { |
- CSA_SLOW_ASSERT(this, IsFixedArray(object)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode)); |
DCHECK(barrier_mode == SKIP_WRITE_BARRIER || |
barrier_mode == UPDATE_WRITE_BARRIER); |
int header_size = |
@@ -1570,7 +1559,6 @@ |
Node* CodeStubAssembler::StoreFixedDoubleArrayElement( |
Node* object, Node* index_node, Node* value, ParameterMode parameter_mode) { |
CSA_ASSERT(this, IsFixedDoubleArray(object)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode)); |
Node* offset = |
ElementOffsetFromIndex(index_node, FAST_DOUBLE_ELEMENTS, parameter_mode, |
FixedArray::kHeaderSize - kHeapObjectTag); |
@@ -1632,7 +1620,6 @@ |
CodeStubArguments& args, |
Variable& arg_index, |
Label* bailout) { |
- CSA_SLOW_ASSERT(this, IsJSArray(array)); |
Comment("BuildAppendJSArray: %s", ElementsKindToString(kind)); |
Label pre_bailout(this); |
Label success(this); |
@@ -1703,7 +1690,6 @@ |
void CodeStubAssembler::BuildAppendJSArray(ElementsKind kind, Node* array, |
Node* value, Label* bailout) { |
- CSA_SLOW_ASSERT(this, IsJSArray(array)); |
Comment("BuildAppendJSArray: %s", ElementsKindToString(kind)); |
ParameterMode mode = OptimalParameterMode(); |
VARIABLE(var_length, OptimalParameterRepresentation(), |
@@ -1763,8 +1749,6 @@ |
ParameterMode mode, |
AllocationFlags flags) { |
Comment("AllocateSeqOneByteString"); |
- CSA_SLOW_ASSERT(this, IsFixedArray(context)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(length, mode)); |
VARIABLE(var_result, MachineRepresentation::kTagged); |
// Compute the SeqOneByteString size and check if it fits into new space. |
@@ -1835,8 +1819,6 @@ |
Node* CodeStubAssembler::AllocateSeqTwoByteString(Node* context, Node* length, |
ParameterMode mode, |
AllocationFlags flags) { |
- CSA_SLOW_ASSERT(this, IsFixedArray(context)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(length, mode)); |
Comment("AllocateSeqTwoByteString"); |
VARIABLE(var_result, MachineRepresentation::kTagged); |
@@ -1892,9 +1874,7 @@ |
Node* CodeStubAssembler::AllocateSlicedString( |
Heap::RootListIndex map_root_index, Node* length, Node* parent, |
Node* offset) { |
- CSA_ASSERT(this, IsString(parent)); |
CSA_ASSERT(this, TaggedIsSmi(length)); |
- CSA_ASSERT(this, TaggedIsSmi(offset)); |
Node* result = Allocate(SlicedString::kSize); |
DCHECK(Heap::RootIsImmortalImmovable(map_root_index)); |
StoreMapNoWriteBarrier(result, map_root_index); |
@@ -1927,8 +1907,6 @@ |
Node* length, Node* first, |
Node* second, |
AllocationFlags flags) { |
- CSA_ASSERT(this, IsString(first)); |
- CSA_ASSERT(this, IsString(second)); |
CSA_ASSERT(this, TaggedIsSmi(length)); |
Node* result = Allocate(ConsString::kSize, flags); |
DCHECK(Heap::RootIsImmortalImmovable(map_root_index)); |
@@ -1968,9 +1946,6 @@ |
Node* CodeStubAssembler::NewConsString(Node* context, Node* length, Node* left, |
Node* right, AllocationFlags flags) { |
- CSA_ASSERT(this, IsFixedArray(context)); |
- CSA_ASSERT(this, IsString(left)); |
- CSA_ASSERT(this, IsString(right)); |
CSA_ASSERT(this, TaggedIsSmi(length)); |
// Added string can be a cons string. |
Comment("Allocating ConsString"); |
@@ -2026,16 +2001,10 @@ |
Node* CodeStubAssembler::AllocateRegExpResult(Node* context, Node* length, |
Node* index, Node* input) { |
- CSA_ASSERT(this, IsFixedArray(context)); |
- CSA_ASSERT(this, TaggedIsSmi(index)); |
- CSA_ASSERT(this, TaggedIsSmi(length)); |
- CSA_ASSERT(this, IsString(input)); |
- |
-#ifdef DEBUG |
Node* const max_length = |
SmiConstant(Smi::FromInt(JSArray::kInitialMaxFastElementArray)); |
CSA_ASSERT(this, SmiLessThanOrEqual(length, max_length)); |
-#endif // DEBUG |
+ USE(max_length); |
// Allocate the JSRegExpResult. |
// TODO(jgruber): Fold JSArray and FixedArray allocations, then remove |
@@ -2156,7 +2125,6 @@ |
void CodeStubAssembler::InitializeJSObjectFromMap(Node* object, Node* map, |
Node* size, Node* properties, |
Node* elements) { |
- CSA_SLOW_ASSERT(this, IsMap(map)); |
// This helper assumes that the object is in new-space, as guarded by the |
// check in AllocatedJSObjectFromMap. |
if (properties == nullptr) { |
@@ -2164,7 +2132,6 @@ |
StoreObjectFieldRoot(object, JSObject::kPropertiesOffset, |
Heap::kEmptyFixedArrayRootIndex); |
} else { |
- CSA_ASSERT(this, IsFixedArray(properties)); |
StoreObjectFieldNoWriteBarrier(object, JSObject::kPropertiesOffset, |
properties); |
} |
@@ -2172,7 +2139,6 @@ |
StoreObjectFieldRoot(object, JSObject::kElementsOffset, |
Heap::kEmptyFixedArrayRootIndex); |
} else { |
- CSA_ASSERT(this, IsFixedArray(elements)); |
StoreObjectFieldNoWriteBarrier(object, JSObject::kElementsOffset, elements); |
} |
InitializeJSObjectBody(object, map, size, JSObject::kHeaderSize); |
@@ -2180,7 +2146,6 @@ |
void CodeStubAssembler::InitializeJSObjectBody(Node* object, Node* map, |
Node* size, int start_offset) { |
- CSA_SLOW_ASSERT(this, IsMap(map)); |
// TODO(cbruni): activate in-object slack tracking machinery. |
Comment("InitializeJSObjectBody"); |
Node* filler = LoadRoot(Heap::kUndefinedValueRootIndex); |
@@ -2210,8 +2175,6 @@ |
Node* CodeStubAssembler::AllocateUninitializedJSArrayWithoutElements( |
ElementsKind kind, Node* array_map, Node* length, Node* allocation_site) { |
Comment("begin allocation of JSArray without elements"); |
- CSA_SLOW_ASSERT(this, TaggedIsPositiveSmi(length)); |
- CSA_SLOW_ASSERT(this, IsMap(array_map)); |
int base_size = JSArray::kSize; |
if (allocation_site != nullptr) { |
base_size += AllocationMemento::kSize; |
@@ -2228,8 +2191,6 @@ |
ElementsKind kind, Node* array_map, Node* length, Node* allocation_site, |
Node* capacity, ParameterMode capacity_mode) { |
Comment("begin allocation of JSArray with elements"); |
- CSA_SLOW_ASSERT(this, TaggedIsPositiveSmi(length)); |
- CSA_SLOW_ASSERT(this, IsMap(array_map)); |
int base_size = JSArray::kSize; |
if (allocation_site != nullptr) { |
@@ -2256,15 +2217,13 @@ |
Node* length, |
Node* allocation_site, |
Node* size_in_bytes) { |
- CSA_SLOW_ASSERT(this, TaggedIsPositiveSmi(length)); |
- CSA_SLOW_ASSERT(this, IsMap(array_map)); |
- |
// Allocate space for the JSArray and the elements FixedArray in one go. |
Node* array = AllocateInNewSpace(size_in_bytes); |
Comment("write JSArray headers"); |
StoreMapNoWriteBarrier(array, array_map); |
+ CSA_ASSERT(this, TaggedIsSmi(length)); |
StoreObjectFieldNoWriteBarrier(array, JSArray::kLengthOffset, length); |
StoreObjectFieldRoot(array, JSArray::kPropertiesOffset, |
@@ -2280,10 +2239,6 @@ |
Node* capacity, Node* length, |
Node* allocation_site, |
ParameterMode capacity_mode) { |
- CSA_SLOW_ASSERT(this, IsMap(array_map)); |
- CSA_SLOW_ASSERT(this, TaggedIsPositiveSmi(length)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(capacity, capacity_mode)); |
- |
Node *array = nullptr, *elements = nullptr; |
if (IsIntPtrOrSmiConstantZero(capacity)) { |
// Array is empty. Use the shared empty fixed array instead of allocating a |
@@ -2317,7 +2272,6 @@ |
Node* capacity_node, |
ParameterMode mode, |
AllocationFlags flags) { |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(capacity_node, mode)); |
CSA_ASSERT(this, IntPtrOrSmiGreaterThan(capacity_node, |
IntPtrOrSmiConstant(0, mode), mode)); |
Node* total_size = GetFixedArrayAllocationSize(capacity_node, kind, mode); |
@@ -2337,9 +2291,6 @@ |
void CodeStubAssembler::FillFixedArrayWithValue( |
ElementsKind kind, Node* array, Node* from_node, Node* to_node, |
Heap::RootListIndex value_root_index, ParameterMode mode) { |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(from_node, mode)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(to_node, mode)); |
- CSA_SLOW_ASSERT(this, IsFixedArrayWithKind(array, kind)); |
bool is_double = IsFastDoubleElementsKind(kind); |
DCHECK(value_root_index == Heap::kTheHoleValueRootIndex || |
value_root_index == Heap::kUndefinedValueRootIndex); |
@@ -2383,10 +2334,6 @@ |
ElementsKind from_kind, Node* from_array, ElementsKind to_kind, |
Node* to_array, Node* element_count, Node* capacity, |
WriteBarrierMode barrier_mode, ParameterMode mode) { |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(element_count, mode)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(capacity, mode)); |
- CSA_SLOW_ASSERT(this, IsFixedArrayWithKindOrEmpty(from_array, from_kind)); |
- CSA_SLOW_ASSERT(this, IsFixedArrayWithKindOrEmpty(to_array, to_kind)); |
STATIC_ASSERT(FixedArray::kHeaderSize == FixedDoubleArray::kHeaderSize); |
const int first_element_offset = FixedArray::kHeaderSize - kHeapObjectTag; |
Comment("[ CopyFixedArrayElements"); |
@@ -2523,12 +2470,6 @@ |
String::Encoding from_encoding, |
String::Encoding to_encoding, |
ParameterMode mode) { |
- // Cannot assert IsString(from_string) and IsString(to_string) here because |
- // CSA::SubString can pass in faked sequential strings when handling external |
- // subject strings. |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(character_count, mode)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(from_index, mode)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(to_index, 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); |
@@ -2587,7 +2528,6 @@ |
ElementsKind from_kind, |
ElementsKind to_kind, |
Label* if_hole) { |
- CSA_SLOW_ASSERT(this, IsFixedArrayWithKind(array, from_kind)); |
if (IsFastDoubleElementsKind(from_kind)) { |
Node* value = |
LoadDoubleWithHoleCheck(array, offset, if_hole, MachineType::Float64()); |
@@ -2614,7 +2554,6 @@ |
Node* CodeStubAssembler::CalculateNewElementsCapacity(Node* old_capacity, |
ParameterMode mode) { |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(old_capacity, mode)); |
Node* half_old_capacity = WordOrSmiShr(old_capacity, 1, mode); |
Node* new_capacity = IntPtrOrSmiAdd(half_old_capacity, old_capacity, mode); |
Node* padding = IntPtrOrSmiConstant(16, mode); |
@@ -2624,9 +2563,6 @@ |
Node* CodeStubAssembler::TryGrowElementsCapacity(Node* object, Node* elements, |
ElementsKind kind, Node* key, |
Label* bailout) { |
- CSA_SLOW_ASSERT(this, TaggedIsNotSmi(object)); |
- CSA_SLOW_ASSERT(this, IsFixedArrayWithKindOrEmpty(elements, kind)); |
- CSA_SLOW_ASSERT(this, TaggedIsSmi(key)); |
Node* capacity = LoadFixedArrayBaseLength(elements); |
ParameterMode mode = OptimalParameterMode(); |
@@ -2643,10 +2579,6 @@ |
ParameterMode mode, |
Label* bailout) { |
Comment("TryGrowElementsCapacity"); |
- CSA_SLOW_ASSERT(this, TaggedIsNotSmi(object)); |
- CSA_SLOW_ASSERT(this, IsFixedArrayWithKindOrEmpty(elements, kind)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(capacity, mode)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(key, mode)); |
// If the gap growth is too big, fall back to the runtime. |
Node* max_gap = IntPtrOrSmiConstant(JSObject::kMaxGap, mode); |
@@ -2664,11 +2596,6 @@ |
Node* object, Node* elements, ElementsKind from_kind, ElementsKind to_kind, |
Node* capacity, Node* new_capacity, ParameterMode mode, Label* bailout) { |
Comment("[ GrowElementsCapacity"); |
- CSA_SLOW_ASSERT(this, TaggedIsNotSmi(object)); |
- CSA_SLOW_ASSERT(this, IsFixedArrayWithKindOrEmpty(elements, from_kind)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(capacity, mode)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(new_capacity, mode)); |
- |
// If size of the allocation for the new capacity doesn't fit in a page |
// that we can bump-pointer allocate from, fall back to the runtime. |
int max_size = FixedArrayBase::GetMaxLengthForNewSpaceAllocation(to_kind); |
@@ -3004,7 +2931,6 @@ |
} |
Node* CodeStubAssembler::ChangeNumberToFloat64(Node* value) { |
- CSA_SLOW_ASSERT(this, IsNumber(value)); |
VARIABLE(result, MachineRepresentation::kFloat64); |
Label smi(this); |
Label done(this, &result); |
@@ -3024,7 +2950,6 @@ |
} |
Node* CodeStubAssembler::ChangeNumberToIntPtr(Node* value) { |
- CSA_SLOW_ASSERT(this, IsNumber(value)); |
VARIABLE(result, MachineType::PointerRepresentation()); |
Label smi(this), done(this, &result); |
GotoIf(TaggedIsSmi(value), &smi); |
@@ -3166,7 +3091,6 @@ |
} |
Node* CodeStubAssembler::IsSpecialReceiverMap(Node* map) { |
- CSA_SLOW_ASSERT(this, IsMap(map)); |
Node* is_special = IsSpecialReceiverInstanceType(LoadMapInstanceType(map)); |
uint32_t mask = |
1 << Map::kHasNamedInterceptor | 1 << Map::kIsAccessCheckNeeded; |
@@ -3293,7 +3217,9 @@ |
Int32Constant(JS_GLOBAL_PROXY_TYPE)); |
} |
-Node* CodeStubAssembler::IsMap(Node* map) { return IsMetaMap(LoadMap(map)); } |
+Node* CodeStubAssembler::IsMap(Node* map) { |
+ return HasInstanceType(map, MAP_TYPE); |
+} |
Node* CodeStubAssembler::IsJSValueInstanceType(Node* instance_type) { |
return Word32Equal(instance_type, Int32Constant(JS_VALUE_TYPE)); |
@@ -3319,45 +3245,6 @@ |
return IsJSArrayInstanceType(LoadMapInstanceType(map)); |
} |
-Node* CodeStubAssembler::IsFixedArray(Node* object) { |
- return HasInstanceType(object, FIXED_ARRAY_TYPE); |
-} |
- |
-// This complicated check is due to elements oddities. If a smi array is empty |
-// after Array.p.shift, it is replaced by the empty array constant. If it is |
-// later filled with a double element, we try to grow it but pass in a double |
-// elements kind. Usually this would cause a size mismatch (since the source |
-// fixed array has FAST_HOLEY_ELEMENTS and destination has |
-// FAST_HOLEY_DOUBLE_ELEMENTS), but we don't have to worry about it when the |
-// source array is empty. |
-// TODO(jgruber): It might we worth creating an empty_double_array constant to |
-// simplify this case. |
-Node* CodeStubAssembler::IsFixedArrayWithKindOrEmpty(Node* object, |
- ElementsKind kind) { |
- Label out(this); |
- VARIABLE(var_result, MachineRepresentation::kWord32, Int32Constant(1)); |
- |
- GotoIf(IsFixedArrayWithKind(object, kind), &out); |
- |
- Node* const length = LoadFixedArrayBaseLength(object); |
- GotoIf(SmiEqual(length, SmiConstant(0)), &out); |
- |
- var_result.Bind(Int32Constant(0)); |
- Goto(&out); |
- |
- BIND(&out); |
- return var_result.value(); |
-} |
- |
-Node* CodeStubAssembler::IsFixedArrayWithKind(Node* object, ElementsKind kind) { |
- if (IsFastDoubleElementsKind(kind)) { |
- return IsFixedDoubleArray(object); |
- } else { |
- DCHECK(IsFastSmiOrObjectElementsKind(kind)); |
- return IsFixedArray(object); |
- } |
-} |
- |
Node* CodeStubAssembler::IsWeakCell(Node* object) { |
return IsWeakCellMap(LoadMap(object)); |
} |
@@ -3376,14 +3263,6 @@ |
Node* CodeStubAssembler::IsAccessorPair(Node* object) { |
return IsAccessorPairMap(LoadMap(object)); |
-} |
- |
-Node* CodeStubAssembler::IsAnyHeapNumber(Node* object) { |
- return Word32Or(IsMutableHeapNumber(object), IsHeapNumber(object)); |
-} |
- |
-Node* CodeStubAssembler::IsMutableHeapNumber(Node* object) { |
- return IsMutableHeapNumberMap(LoadMap(object)); |
} |
Node* CodeStubAssembler::IsHeapNumber(Node* object) { |
@@ -3517,7 +3396,7 @@ |
Node* CodeStubAssembler::StringCharCodeAt(Node* string, Node* index, |
ParameterMode parameter_mode) { |
- CSA_ASSERT(this, MatchesParameterMode(index, parameter_mode)); |
+ if (parameter_mode == SMI_PARAMETERS) CSA_ASSERT(this, TaggedIsSmi(index)); |
CSA_ASSERT(this, IsString(string)); |
// Translate the {index} into a Word. |
@@ -3629,7 +3508,6 @@ |
} |
BIND(&if_done); |
- CSA_ASSERT(this, IsString(var_result.value())); |
return var_result.value(); |
} |
@@ -3832,7 +3710,6 @@ |
} |
BIND(&end); |
- CSA_ASSERT(this, IsString(var_result.value())); |
return var_result.value(); |
} |
@@ -3978,6 +3855,26 @@ |
BIND(&out); |
return var_result.value(); |
+} |
+ |
+Node* CodeStubAssembler::TryDerefExternalString(Node* const string, |
+ Node* const instance_type, |
+ Label* if_bailout) { |
+ Label out(this); |
+ |
+ CSA_ASSERT(this, IsExternalStringInstanceType(instance_type)); |
+ GotoIf(IsShortExternalStringInstanceType(instance_type), if_bailout); |
+ |
+ // Move the pointer so that offset-wise, it looks like a sequential string. |
+ STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize); |
+ |
+ Node* resource_data = LoadObjectField( |
+ string, ExternalString::kResourceDataOffset, MachineType::Pointer()); |
+ Node* const fake_sequential_string = |
+ IntPtrSub(resource_data, |
+ IntPtrConstant(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); |
+ |
+ return fake_sequential_string; |
} |
void CodeStubAssembler::MaybeDerefIndirectString(Variable* var_string, |
@@ -4185,12 +4082,10 @@ |
} |
BIND(&return_result); |
- CSA_ASSERT(this, IsString(var_result.value())); |
return var_result.value(); |
} |
Node* CodeStubAssembler::StringToNumber(Node* context, Node* input) { |
- CSA_SLOW_ASSERT(this, IsString(input)); |
Label runtime(this, Label::kDeferred); |
Label end(this); |
@@ -4245,7 +4140,7 @@ |
Node* hash = Word32Xor(low, high); |
hash = ChangeInt32ToIntPtr(hash); |
hash = WordShl(hash, one); |
- Node* index = WordAnd(hash, WordSar(mask, SmiShiftBitsConstant())); |
+ Node* index = WordAnd(hash, SmiUntag(BitcastWordToTagged(mask))); |
// Cache entry's key must be a heap number |
Node* number_key = LoadFixedArrayElement(number_string_cache, index); |
@@ -4290,7 +4185,6 @@ |
} |
BIND(&done); |
- CSA_ASSERT(this, IsString(result.value())); |
return result.value(); |
} |
@@ -4337,7 +4231,6 @@ |
} |
BIND(&end); |
- CSA_ASSERT(this, IsName(var_result.value())); |
return var_result.value(); |
} |
@@ -4426,7 +4319,6 @@ |
} |
BIND(&end); |
- CSA_ASSERT(this, IsNumber(var_result.value())); |
return var_result.value(); |
} |
@@ -4456,7 +4348,6 @@ |
} |
BIND(&end); |
- CSA_ASSERT(this, IsNumber(var_result.value())); |
return var_result.value(); |
} |
@@ -4559,7 +4450,6 @@ |
} |
BIND(&out); |
- CSA_ASSERT(this, IsNumber(var_result.value())); |
return var_result.value(); |
} |
@@ -4668,7 +4558,6 @@ |
Goto(&done); |
BIND(&done); |
- CSA_SLOW_ASSERT(this, TaggedIsSmi(result.value())); |
return result.value(); |
} |
@@ -4693,7 +4582,6 @@ |
Goto(&done); |
BIND(&done); |
- CSA_SLOW_ASSERT(this, TaggedIsSmi(result.value())); |
return result.value(); |
} |
@@ -4763,7 +4651,6 @@ |
} |
BIND(&out); |
- CSA_SLOW_ASSERT(this, IsNumber(var_arg.value())); |
return var_arg.value(); |
} |
@@ -4880,7 +4767,6 @@ |
Variable* var_internalized, Label* if_not_internalized, Label* if_bailout) { |
DCHECK(var_index->rep() == MachineType::PointerRepresentation()); |
DCHECK(var_internalized->rep() == MachineRepresentation::kTagged); |
- CSA_SLOW_ASSERT(this, IsString(string)); |
Node* function = ExternalConstant( |
ExternalReference::try_internalize_string_function(isolate())); |
Node* result = CallCFunction1(MachineType::AnyTagged(), |
@@ -5128,8 +5014,6 @@ |
Node* name, Node* value, |
Node* index, |
Node* enum_index) { |
- CSA_SLOW_ASSERT(this, IsDictionary(dictionary)); |
- |
// Store name and value. |
StoreFixedArrayElement(dictionary, index, name); |
StoreValueByKeyIndex<NameDictionary>(dictionary, index, value); |
@@ -5171,7 +5055,6 @@ |
template <class Dictionary> |
void CodeStubAssembler::Add(Node* dictionary, Node* key, Node* value, |
Label* bailout) { |
- CSA_SLOW_ASSERT(this, IsDictionary(dictionary)); |
Node* capacity = GetCapacity<Dictionary>(dictionary); |
Node* nof = GetNumberOfElements<Dictionary>(dictionary); |
Node* new_nof = SmiAdd(nof, SmiConstant(1)); |
@@ -6886,8 +6769,6 @@ |
const CodeStubAssembler::VariableList& vars, Node* start_index, |
Node* end_index, const FastLoopBody& body, int increment, |
ParameterMode parameter_mode, IndexAdvanceMode advance_mode) { |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(start_index, parameter_mode)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(end_index, parameter_mode)); |
MachineRepresentation index_rep = (parameter_mode == INTPTR_PARAMETERS) |
? MachineType::PointerRepresentation() |
: MachineRepresentation::kTaggedSigned; |
@@ -6925,9 +6806,6 @@ |
Node* last_element_exclusive, const FastFixedArrayForEachBody& body, |
ParameterMode mode, ForEachDirection direction) { |
STATIC_ASSERT(FixedArray::kHeaderSize == FixedDoubleArray::kHeaderSize); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(first_element_inclusive, mode)); |
- CSA_SLOW_ASSERT(this, MatchesParameterMode(last_element_exclusive, mode)); |
- CSA_SLOW_ASSERT(this, IsFixedArrayWithKind(fixed_array, kind)); |
int32_t first_val; |
bool constant_first = ToInt32Constant(first_element_inclusive, first_val); |
int32_t last_val; |
@@ -6988,7 +6866,6 @@ |
void CodeStubAssembler::InitializeFieldsWithRoot( |
Node* object, Node* start_offset, Node* end_offset, |
Heap::RootListIndex root_index) { |
- CSA_SLOW_ASSERT(this, TaggedIsNotSmi(object)); |
start_offset = IntPtrAdd(start_offset, IntPtrConstant(-kHeapObjectTag)); |
end_offset = IntPtrAdd(end_offset, IntPtrConstant(-kHeapObjectTag)); |
Node* root_value = LoadRoot(root_index); |
@@ -7004,9 +6881,6 @@ |
void CodeStubAssembler::BranchIfNumericRelationalComparison( |
RelationalComparisonMode mode, Node* lhs, Node* rhs, Label* if_true, |
Label* if_false) { |
- CSA_SLOW_ASSERT(this, IsNumber(lhs)); |
- CSA_SLOW_ASSERT(this, IsNumber(rhs)); |
- |
Label end(this); |
VARIABLE(result, MachineRepresentation::kTagged); |
@@ -7119,9 +6993,6 @@ |
Node* lhs, Node* rhs, |
Node* context, |
Variable* var_type_feedback) { |
- CSA_SLOW_ASSERT(this, IsNumber(lhs)); |
- CSA_SLOW_ASSERT(this, IsNumber(rhs)); |
- |
Label return_true(this), return_false(this), end(this); |
VARIABLE(result, MachineRepresentation::kTagged); |
@@ -9241,8 +9112,6 @@ |
Node* CodeStubAssembler::AllocateFunctionWithMapAndContext(Node* map, |
Node* shared_info, |
Node* context) { |
- CSA_SLOW_ASSERT(this, IsMap(map)); |
- |
Node* const code = BitcastTaggedToWord( |
LoadObjectField(shared_info, SharedFunctionInfo::kCodeOffset)); |
Node* const code_entry = |