Commit 62b0de1e authored by jgruber's avatar jgruber Committed by Commit bot

[csa] Add assertions to CSA

This adds a bunch of assertions to CSA, mostly about documenting and checking
parameter types.

Drive-by-change: Removed unused function.

BUG=v8:6325

Review-Url: https://codereview.chromium.org/2847923003
Cr-Original-Commit-Position: refs/heads/master@{#45398}
Committed: https://chromium.googlesource.com/v8/v8/+/b14a981496ad1f841683479d2f9188dfa2d6b4bd
Review-Url: https://codereview.chromium.org/2847923003
Cr-Commit-Position: refs/heads/master@{#45443}
parent 897c2ca3
This diff is collapsed.
...@@ -27,10 +27,8 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol }; ...@@ -27,10 +27,8 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
V(AllocationSiteMap, AllocationSiteMap) \ V(AllocationSiteMap, AllocationSiteMap) \
V(BooleanMap, BooleanMap) \ V(BooleanMap, BooleanMap) \
V(CodeMap, CodeMap) \ V(CodeMap, CodeMap) \
V(empty_string, EmptyString) \
V(length_string, LengthString) \
V(prototype_string, PrototypeString) \
V(EmptyFixedArray, EmptyFixedArray) \ V(EmptyFixedArray, EmptyFixedArray) \
V(empty_string, EmptyString) \
V(EmptyWeakCell, EmptyWeakCell) \ V(EmptyWeakCell, EmptyWeakCell) \
V(FalseValue, False) \ V(FalseValue, False) \
V(FeedbackVectorMap, FeedbackVectorMap) \ V(FeedbackVectorMap, FeedbackVectorMap) \
...@@ -38,23 +36,27 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol }; ...@@ -38,23 +36,27 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
V(FixedCOWArrayMap, FixedCOWArrayMap) \ V(FixedCOWArrayMap, FixedCOWArrayMap) \
V(FixedDoubleArrayMap, FixedDoubleArrayMap) \ V(FixedDoubleArrayMap, FixedDoubleArrayMap) \
V(FunctionTemplateInfoMap, FunctionTemplateInfoMap) \ V(FunctionTemplateInfoMap, FunctionTemplateInfoMap) \
V(GlobalPropertyCellMap, PropertyCellMap) \
V(has_instance_symbol, HasInstanceSymbol) \ V(has_instance_symbol, HasInstanceSymbol) \
V(HeapNumberMap, HeapNumberMap) \ V(HeapNumberMap, HeapNumberMap) \
V(NoClosuresCellMap, NoClosuresCellMap) \ V(length_string, LengthString) \
V(OneClosureCellMap, OneClosureCellMap) \
V(ManyClosuresCellMap, ManyClosuresCellMap) \ V(ManyClosuresCellMap, ManyClosuresCellMap) \
V(MetaMap, MetaMap) \
V(MinusZeroValue, MinusZero) \ V(MinusZeroValue, MinusZero) \
V(MutableHeapNumberMap, MutableHeapNumberMap) \
V(NanValue, Nan) \ V(NanValue, Nan) \
V(NoClosuresCellMap, NoClosuresCellMap) \
V(NullValue, Null) \ V(NullValue, Null) \
V(GlobalPropertyCellMap, PropertyCellMap) \ V(OneClosureCellMap, OneClosureCellMap) \
V(prototype_string, PrototypeString) \
V(SpeciesProtector, SpeciesProtector) \
V(SymbolMap, SymbolMap) \ V(SymbolMap, SymbolMap) \
V(TheHoleValue, TheHole) \ V(TheHoleValue, TheHole) \
V(TrueValue, True) \ V(TrueValue, True) \
V(Tuple2Map, Tuple2Map) \ V(Tuple2Map, Tuple2Map) \
V(Tuple3Map, Tuple3Map) \ V(Tuple3Map, Tuple3Map) \
V(UndefinedValue, Undefined) \ V(UndefinedValue, Undefined) \
V(WeakCellMap, WeakCellMap) \ V(WeakCellMap, WeakCellMap)
V(SpeciesProtector, SpeciesProtector)
// Provides JavaScript-specific "macro-assembler" functionality on top of the // Provides JavaScript-specific "macro-assembler" functionality on top of the
// CodeAssembler. By factoring the JavaScript-isms out of the CodeAssembler, // CodeAssembler. By factoring the JavaScript-isms out of the CodeAssembler,
...@@ -116,6 +118,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -116,6 +118,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
return value; return value;
} }
Node* MatchesParameterMode(Node* value, ParameterMode mode);
#define PARAMETER_BINOP(OpName, IntPtrOpName, SmiOpName) \ #define PARAMETER_BINOP(OpName, IntPtrOpName, SmiOpName) \
Node* OpName(Node* a, Node* b, ParameterMode mode) { \ Node* OpName(Node* a, Node* b, ParameterMode mode) { \
if (mode == SMI_PARAMETERS) { \ if (mode == SMI_PARAMETERS) { \
...@@ -770,6 +774,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -770,6 +774,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* IsPropertyCell(Node* object); Node* IsPropertyCell(Node* object);
Node* IsAccessorInfo(Node* object); Node* IsAccessorInfo(Node* object);
Node* IsAccessorPair(Node* object); Node* IsAccessorPair(Node* object);
Node* IsAnyHeapNumber(Node* object);
Node* IsMutableHeapNumber(Node* object);
Node* IsHeapNumber(Node* object); Node* IsHeapNumber(Node* object);
Node* IsName(Node* object); Node* IsName(Node* object);
Node* IsSymbol(Node* object); Node* IsSymbol(Node* object);
...@@ -780,6 +786,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -780,6 +786,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* IsJSArrayInstanceType(Node* instance_type); Node* IsJSArrayInstanceType(Node* instance_type);
Node* IsJSArray(Node* object); Node* IsJSArray(Node* object);
Node* IsJSArrayMap(Node* object); Node* IsJSArrayMap(Node* object);
Node* IsFixedArray(Node* object);
Node* IsFixedArrayWithKindOrEmpty(Node* object, ElementsKind kind);
Node* IsFixedArrayWithKind(Node* object, ElementsKind kind);
Node* IsNativeContext(Node* object); Node* IsNativeContext(Node* object);
Node* IsWeakCell(Node* object); Node* IsWeakCell(Node* object);
Node* IsFixedDoubleArray(Node* object); Node* IsFixedDoubleArray(Node* object);
...@@ -830,16 +839,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -830,16 +839,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* StringAdd(Node* context, Node* first, Node* second, Node* StringAdd(Node* context, Node* first, Node* second,
AllocationFlags flags = kNone); AllocationFlags flags = kNone);
// Unpack the external string, returning a pointer that (offset-wise) looks
// like a sequential string.
// Note that this pointer is not tagged and does not point to a real
// sequential string instance, and may only be used to access the string
// data. The pointer is GC-safe as long as a reference to the container
// ExternalString is live.
// |string| must be an external string. Bailout for short external strings.
Node* TryDerefExternalString(Node* const string, Node* const instance_type,
Label* if_bailout);
// Check if |var_string| has an indirect (thin or flat cons) string type, // Check if |var_string| has an indirect (thin or flat cons) string type,
// and unpack it if so. // and unpack it if so.
void MaybeDerefIndirectString(Variable* var_string, Node* instance_type, void MaybeDerefIndirectString(Variable* var_string, Node* instance_type,
......
...@@ -633,6 +633,10 @@ ...@@ -633,6 +633,10 @@
# Slow tests. # Slow tests.
'ignition/regress-599001-verifyheap': [SKIP], 'ignition/regress-599001-verifyheap': [SKIP],
'regress/regress-2185-2': [SKIP], 'regress/regress-2185-2': [SKIP],
# Crankshaft bug, wrong elements kind: crbug.com/v8/6342
'regress/regress-2671': [SKIP],
'regress/regress-2671-1': [SKIP],
}], # variant == noturbofan_stress }], # variant == noturbofan_stress
############################################################################## ##############################################################################
......
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