Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: src/code-stub-assembler.h

Issue 2892023002: Revert of [csa] Add assertions to CSA (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.h
diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h
index 9cee969cfd6c34ce4f9daa9e5654d12b3dad0723..c5520d92d17ba9460141184335ed17188e591f3a 100644
--- a/src/code-stub-assembler.h
+++ b/src/code-stub-assembler.h
@@ -18,44 +18,6 @@
class CodeStubArguments;
class StatsCounter;
class StubCache;
-
-#define CSA_CHECK(csa, x) \
- (csa)->Check([&] { return (x); }, #x, __FILE__, __LINE__)
-
-#ifdef DEBUG
-#define CSA_ASSERT(csa, x) \
- (csa)->Assert([&] { return (x); }, #x, __FILE__, __LINE__)
-#define CSA_ASSERT_JS_ARGC_OP(csa, Op, op, expected) \
- (csa)->Assert( \
- [&] { \
- compiler::Node* const argc = \
- (csa)->Parameter(Descriptor::kActualArgumentsCount); \
- return (csa)->Op(argc, (csa)->Int32Constant(expected)); \
- }, \
- "argc " #op " " #expected, __FILE__, __LINE__)
-
-#define CSA_ASSERT_JS_ARGC_EQ(csa, expected) \
- CSA_ASSERT_JS_ARGC_OP(csa, Word32Equal, ==, expected)
-
-#define BIND(label) Bind(label, {#label, __FILE__, __LINE__})
-#define VARIABLE(name, ...) \
- Variable name(this, {#name, __FILE__, __LINE__}, __VA_ARGS__);
-
-#else // DEBUG
-#define CSA_ASSERT(csa, x) ((void)0)
-#define CSA_ASSERT_JS_ARGC_EQ(csa, expected) ((void)0)
-#define BIND(label) Bind(label);
-#define VARIABLE(name, ...) Variable name(this, __VA_ARGS__);
-#endif // DEBUG
-
-#ifdef ENABLE_SLOW_DCHECKS
-#define CSA_SLOW_ASSERT(csa, x) \
- if (FLAG_enable_slow_asserts) { \
- CSA_ASSERT(csa, x); \
- }
-#else
-#define CSA_SLOW_ASSERT(csa, x) ((void)0)
-#endif
enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
@@ -65,8 +27,10 @@
V(AllocationSiteMap, AllocationSiteMap) \
V(BooleanMap, BooleanMap) \
V(CodeMap, CodeMap) \
+ V(empty_string, EmptyString) \
+ V(length_string, LengthString) \
+ V(prototype_string, PrototypeString) \
V(EmptyFixedArray, EmptyFixedArray) \
- V(empty_string, EmptyString) \
V(EmptyWeakCell, EmptyWeakCell) \
V(FalseValue, False) \
V(FeedbackVectorMap, FeedbackVectorMap) \
@@ -74,27 +38,23 @@
V(FixedCOWArrayMap, FixedCOWArrayMap) \
V(FixedDoubleArrayMap, FixedDoubleArrayMap) \
V(FunctionTemplateInfoMap, FunctionTemplateInfoMap) \
- V(GlobalPropertyCellMap, PropertyCellMap) \
V(has_instance_symbol, HasInstanceSymbol) \
V(HeapNumberMap, HeapNumberMap) \
- V(length_string, LengthString) \
+ V(NoClosuresCellMap, NoClosuresCellMap) \
+ V(OneClosureCellMap, OneClosureCellMap) \
V(ManyClosuresCellMap, ManyClosuresCellMap) \
- V(MetaMap, MetaMap) \
V(MinusZeroValue, MinusZero) \
- V(MutableHeapNumberMap, MutableHeapNumberMap) \
V(NanValue, Nan) \
- V(NoClosuresCellMap, NoClosuresCellMap) \
V(NullValue, Null) \
- V(OneClosureCellMap, OneClosureCellMap) \
- V(prototype_string, PrototypeString) \
- V(SpeciesProtector, SpeciesProtector) \
+ V(GlobalPropertyCellMap, PropertyCellMap) \
V(SymbolMap, SymbolMap) \
V(TheHoleValue, TheHole) \
V(TrueValue, True) \
V(Tuple2Map, Tuple2Map) \
V(Tuple3Map, Tuple3Map) \
V(UndefinedValue, Undefined) \
- V(WeakCellMap, WeakCellMap)
+ V(WeakCellMap, WeakCellMap) \
+ V(SpeciesProtector, SpeciesProtector)
// Provides JavaScript-specific "macro-assembler" functionality on top of the
// CodeAssembler. By factoring the JavaScript-isms out of the CodeAssembler,
@@ -156,8 +116,6 @@
if (mode != SMI_PARAMETERS) value = SmiUntag(value);
return value;
}
-
- Node* MatchesParameterMode(Node* value, ParameterMode mode);
#define PARAMETER_BINOP(OpName, IntPtrOpName, SmiOpName) \
Node* OpName(Node* a, Node* b, ParameterMode mode) { \
@@ -227,8 +185,6 @@
// Smi operations.
#define SMI_ARITHMETIC_BINOP(SmiOpName, IntPtrOpName) \
Node* SmiOpName(Node* a, Node* b) { \
- CSA_SLOW_ASSERT(this, TaggedIsSmi(a)); \
- CSA_SLOW_ASSERT(this, TaggedIsSmi(b)); \
return BitcastWordToTaggedSigned( \
IntPtrOpName(BitcastTaggedToWord(a), BitcastTaggedToWord(b))); \
}
@@ -239,12 +195,10 @@
#undef SMI_ARITHMETIC_BINOP
Node* SmiShl(Node* a, int shift) {
- CSA_SLOW_ASSERT(this, TaggedIsSmi(a));
return BitcastWordToTaggedSigned(WordShl(BitcastTaggedToWord(a), shift));
}
Node* SmiShr(Node* a, int shift) {
- CSA_SLOW_ASSERT(this, TaggedIsSmi(a));
return BitcastWordToTaggedSigned(
WordAnd(WordShr(BitcastTaggedToWord(a), shift),
BitcastTaggedToWord(SmiConstant(-1))));
@@ -270,8 +224,6 @@
#define SMI_COMPARISON_OP(SmiOpName, IntPtrOpName) \
Node* SmiOpName(Node* a, Node* b) { \
- CSA_SLOW_ASSERT(this, TaggedIsSmi(a)); \
- CSA_SLOW_ASSERT(this, TaggedIsSmi(b)); \
return IntPtrOpName(BitcastTaggedToWord(a), BitcastTaggedToWord(b)); \
}
SMI_COMPARISON_OP(SmiEqual, WordEqual)
@@ -811,8 +763,6 @@
Node* IsPropertyCell(Node* object);
Node* IsAccessorInfo(Node* object);
Node* IsAccessorPair(Node* object);
- Node* IsAnyHeapNumber(Node* object);
- Node* IsMutableHeapNumber(Node* object);
Node* IsHeapNumber(Node* object);
Node* IsName(Node* object);
Node* IsSymbol(Node* object);
@@ -823,9 +773,6 @@
Node* IsJSArrayInstanceType(Node* instance_type);
Node* IsJSArray(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* IsWeakCell(Node* object);
Node* IsFixedDoubleArray(Node* object);
@@ -875,6 +822,16 @@
// Return a new string object produced by concatenating |first| with |second|.
Node* StringAdd(Node* context, Node* first, Node* second,
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,
// and unpack it if so.
@@ -1645,6 +1602,44 @@
const Flags flags_;
};
+#define CSA_CHECK(csa, x) \
+ (csa)->Check([&] { return (x); }, #x, __FILE__, __LINE__)
+
+#ifdef DEBUG
+#define CSA_ASSERT(csa, x) \
+ (csa)->Assert([&] { return (x); }, #x, __FILE__, __LINE__)
+#define CSA_ASSERT_JS_ARGC_OP(csa, Op, op, expected) \
+ (csa)->Assert( \
+ [&] { \
+ compiler::Node* const argc = \
+ (csa)->Parameter(Descriptor::kActualArgumentsCount); \
+ return (csa)->Op(argc, (csa)->Int32Constant(expected)); \
+ }, \
+ "argc " #op " " #expected, __FILE__, __LINE__)
+
+#define CSA_ASSERT_JS_ARGC_EQ(csa, expected) \
+ CSA_ASSERT_JS_ARGC_OP(csa, Word32Equal, ==, expected)
+
+#define BIND(label) Bind(label, {#label, __FILE__, __LINE__})
+#define VARIABLE(name, ...) \
+ Variable name(this, {#name, __FILE__, __LINE__}, __VA_ARGS__);
+
+#else // DEBUG
+#define CSA_ASSERT(csa, x) ((void)0)
+#define CSA_ASSERT_JS_ARGC_EQ(csa, expected) ((void)0)
+#define BIND(label) Bind(label);
+#define VARIABLE(name, ...) Variable name(this, __VA_ARGS__);
+#endif // DEBUG
+
+#ifdef ENABLE_SLOW_DCHECKS
+#define CSA_SLOW_ASSERT(csa, x) \
+ if (FLAG_enable_slow_asserts) { \
+ CSA_ASSERT(csa, x); \
+ }
+#else
+#define CSA_SLOW_ASSERT(csa, x) ((void)0)
+#endif
+
DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags);
} // namespace internal
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698