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

Side by Side Diff: src/code-stub-assembler.h

Issue 2847923003: [csa] Add assertions to CSA (Closed)
Patch Set: Rebase & fix incorrect asserts Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_CODE_STUB_ASSEMBLER_H_ 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_
6 #define V8_CODE_STUB_ASSEMBLER_H_ 6 #define V8_CODE_STUB_ASSEMBLER_H_
7 7
8 #include <functional> 8 #include <functional>
9 9
10 #include "src/compiler/code-assembler.h" 10 #include "src/compiler/code-assembler.h"
(...skipping 23 matching lines...) Expand all
34 V(FeedbackVectorMap, FeedbackVectorMap) \ 34 V(FeedbackVectorMap, FeedbackVectorMap) \
35 V(FixedArrayMap, FixedArrayMap) \ 35 V(FixedArrayMap, FixedArrayMap) \
36 V(FixedCOWArrayMap, FixedCOWArrayMap) \ 36 V(FixedCOWArrayMap, FixedCOWArrayMap) \
37 V(FixedDoubleArrayMap, FixedDoubleArrayMap) \ 37 V(FixedDoubleArrayMap, FixedDoubleArrayMap) \
38 V(FunctionTemplateInfoMap, FunctionTemplateInfoMap) \ 38 V(FunctionTemplateInfoMap, FunctionTemplateInfoMap) \
39 V(GlobalPropertyCellMap, PropertyCellMap) \ 39 V(GlobalPropertyCellMap, PropertyCellMap) \
40 V(has_instance_symbol, HasInstanceSymbol) \ 40 V(has_instance_symbol, HasInstanceSymbol) \
41 V(HeapNumberMap, HeapNumberMap) \ 41 V(HeapNumberMap, HeapNumberMap) \
42 V(length_string, LengthString) \ 42 V(length_string, LengthString) \
43 V(ManyClosuresCellMap, ManyClosuresCellMap) \ 43 V(ManyClosuresCellMap, ManyClosuresCellMap) \
44 V(MetaMap, MetaMap) \
44 V(MinusZeroValue, MinusZero) \ 45 V(MinusZeroValue, MinusZero) \
45 V(MutableHeapNumberMap, MutableHeapNumberMap) \ 46 V(MutableHeapNumberMap, MutableHeapNumberMap) \
46 V(NanValue, Nan) \ 47 V(NanValue, Nan) \
47 V(NoClosuresCellMap, NoClosuresCellMap) \ 48 V(NoClosuresCellMap, NoClosuresCellMap) \
48 V(NullValue, Null) \ 49 V(NullValue, Null) \
49 V(OneClosureCellMap, OneClosureCellMap) \ 50 V(OneClosureCellMap, OneClosureCellMap) \
50 V(prototype_string, PrototypeString) \ 51 V(prototype_string, PrototypeString) \
51 V(SpeciesProtector, SpeciesProtector) \ 52 V(SpeciesProtector, SpeciesProtector) \
52 V(SymbolMap, SymbolMap) \ 53 V(SymbolMap, SymbolMap) \
53 V(TheHoleValue, TheHole) \ 54 V(TheHoleValue, TheHole) \
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 Node* ParameterToTagged(Node* value, ParameterMode mode) { 111 Node* ParameterToTagged(Node* value, ParameterMode mode) {
111 if (mode != SMI_PARAMETERS) value = SmiTag(value); 112 if (mode != SMI_PARAMETERS) value = SmiTag(value);
112 return value; 113 return value;
113 } 114 }
114 115
115 Node* TaggedToParameter(Node* value, ParameterMode mode) { 116 Node* TaggedToParameter(Node* value, ParameterMode mode) {
116 if (mode != SMI_PARAMETERS) value = SmiUntag(value); 117 if (mode != SMI_PARAMETERS) value = SmiUntag(value);
117 return value; 118 return value;
118 } 119 }
119 120
121 Node* MatchesParameterMode(Node* value, ParameterMode mode);
122
120 #define PARAMETER_BINOP(OpName, IntPtrOpName, SmiOpName) \ 123 #define PARAMETER_BINOP(OpName, IntPtrOpName, SmiOpName) \
121 Node* OpName(Node* a, Node* b, ParameterMode mode) { \ 124 Node* OpName(Node* a, Node* b, ParameterMode mode) { \
122 if (mode == SMI_PARAMETERS) { \ 125 if (mode == SMI_PARAMETERS) { \
123 return SmiOpName(a, b); \ 126 return SmiOpName(a, b); \
124 } else { \ 127 } else { \
125 DCHECK_EQ(INTPTR_PARAMETERS, mode); \ 128 DCHECK_EQ(INTPTR_PARAMETERS, mode); \
126 return IntPtrOpName(a, b); \ 129 return IntPtrOpName(a, b); \
127 } \ 130 } \
128 } 131 }
129 PARAMETER_BINOP(IntPtrOrSmiMin, IntPtrMin, SmiMin) 132 PARAMETER_BINOP(IntPtrOrSmiMin, IntPtrMin, SmiMin)
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 Node* IsJSReceiver(Node* object); 772 Node* IsJSReceiver(Node* object);
770 Node* IsJSReceiverMap(Node* map); 773 Node* IsJSReceiverMap(Node* map);
771 Node* IsMap(Node* object); 774 Node* IsMap(Node* object);
772 Node* IsCallableMap(Node* map); 775 Node* IsCallableMap(Node* map);
773 Node* IsDeprecatedMap(Node* map); 776 Node* IsDeprecatedMap(Node* map);
774 Node* IsCallable(Node* object); 777 Node* IsCallable(Node* object);
775 Node* IsBoolean(Node* object); 778 Node* IsBoolean(Node* object);
776 Node* IsPropertyCell(Node* object); 779 Node* IsPropertyCell(Node* object);
777 Node* IsAccessorInfo(Node* object); 780 Node* IsAccessorInfo(Node* object);
778 Node* IsAccessorPair(Node* object); 781 Node* IsAccessorPair(Node* object);
782 Node* IsAnyHeapNumber(Node* object);
779 Node* IsHeapNumber(Node* object); 783 Node* IsHeapNumber(Node* object);
780 Node* IsMutableHeapNumber(Node* object); 784 Node* IsMutableHeapNumber(Node* object);
781 Node* IsName(Node* object); 785 Node* IsName(Node* object);
782 Node* IsSymbolInstanceType(Node* instance_type); 786 Node* IsSymbolInstanceType(Node* instance_type);
783 Node* IsSymbol(Node* object); 787 Node* IsSymbol(Node* object);
784 Node* IsPrivateSymbol(Node* object); 788 Node* IsPrivateSymbol(Node* object);
785 Node* IsJSValueInstanceType(Node* instance_type); 789 Node* IsJSValueInstanceType(Node* instance_type);
786 Node* IsJSValue(Node* object); 790 Node* IsJSValue(Node* object);
787 Node* IsJSValueMap(Node* map); 791 Node* IsJSValueMap(Node* map);
788 Node* IsJSArrayInstanceType(Node* instance_type); 792 Node* IsJSArrayInstanceType(Node* instance_type);
789 Node* IsJSArray(Node* object); 793 Node* IsJSArray(Node* object);
790 Node* IsJSArrayMap(Node* object); 794 Node* IsJSArrayMap(Node* object);
795 Node* IsFixedArray(Node* object);
796 Node* IsFixedArrayWithKindOrEmpty(Node* object, ElementsKind kind);
797 Node* IsFixedArrayWithKind(Node* object, ElementsKind kind);
791 Node* IsNativeContext(Node* object); 798 Node* IsNativeContext(Node* object);
792 Node* IsWeakCell(Node* object); 799 Node* IsWeakCell(Node* object);
793 Node* IsFixedDoubleArray(Node* object); 800 Node* IsFixedDoubleArray(Node* object);
794 Node* IsHashTable(Node* object); 801 Node* IsHashTable(Node* object);
795 Node* IsDictionary(Node* object); 802 Node* IsDictionary(Node* object);
796 Node* IsUnseededNumberDictionary(Node* object); 803 Node* IsUnseededNumberDictionary(Node* object);
797 Node* IsConstructorMap(Node* map); 804 Node* IsConstructorMap(Node* map);
798 Node* IsJSFunctionInstanceType(Node* instance_type); 805 Node* IsJSFunctionInstanceType(Node* instance_type);
799 Node* IsJSFunction(Node* object); 806 Node* IsJSFunction(Node* object);
800 Node* IsJSFunctionMap(Node* object); 807 Node* IsJSFunctionMap(Node* object);
(...skipping 30 matching lines...) Expand all
831 // [from,to[ of string. |from| and |to| are expected to be tagged. 838 // [from,to[ of string. |from| and |to| are expected to be tagged.
832 // If flags has the value FROM_TO_ARE_BOUNDED then from and to are in 839 // If flags has the value FROM_TO_ARE_BOUNDED then from and to are in
833 // the range [0, string-length) 840 // the range [0, string-length)
834 Node* SubString(Node* context, Node* string, Node* from, Node* to, 841 Node* SubString(Node* context, Node* string, Node* from, Node* to,
835 SubStringFlags flags = SubStringFlags::NONE); 842 SubStringFlags flags = SubStringFlags::NONE);
836 843
837 // Return a new string object produced by concatenating |first| with |second|. 844 // Return a new string object produced by concatenating |first| with |second|.
838 Node* StringAdd(Node* context, Node* first, Node* second, 845 Node* StringAdd(Node* context, Node* first, Node* second,
839 AllocationFlags flags = kNone); 846 AllocationFlags flags = kNone);
840 847
841 // Unpack the external string, returning a pointer that (offset-wise) looks
842 // like a sequential string.
843 // Note that this pointer is not tagged and does not point to a real
844 // sequential string instance, and may only be used to access the string
845 // data. The pointer is GC-safe as long as a reference to the container
846 // ExternalString is live.
847 // |string| must be an external string. Bailout for short external strings.
848 Node* TryDerefExternalString(Node* const string, Node* const instance_type,
849 Label* if_bailout);
850
851 // Check if |string| is an indirect (thin or flat cons) string type that can 848 // Check if |string| is an indirect (thin or flat cons) string type that can
852 // be dereferenced by DerefIndirectString. 849 // be dereferenced by DerefIndirectString.
853 void BranchIfCanDerefIndirectString(Node* string, Node* instance_type, 850 void BranchIfCanDerefIndirectString(Node* string, Node* instance_type,
854 Label* can_deref, Label* cannot_deref); 851 Label* can_deref, Label* cannot_deref);
855 // Unpack an indirect (thin or flat cons) string type. 852 // Unpack an indirect (thin or flat cons) string type.
856 void DerefIndirectString(Variable* var_string, Node* instance_type); 853 void DerefIndirectString(Variable* var_string, Node* instance_type);
857 // Check if |var_string| has an indirect (thin or flat cons) string type, 854 // Check if |var_string| has an indirect (thin or flat cons) string type,
858 // and unpack it if so. 855 // and unpack it if so.
859 void MaybeDerefIndirectString(Variable* var_string, Node* instance_type, 856 void MaybeDerefIndirectString(Variable* var_string, Node* instance_type,
860 Variable* var_did_something); 857 Variable* var_did_something);
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 } 1666 }
1670 #else 1667 #else
1671 #define CSA_SLOW_ASSERT(csa, x) ((void)0) 1668 #define CSA_SLOW_ASSERT(csa, x) ((void)0)
1672 #endif 1669 #endif
1673 1670
1674 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); 1671 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags);
1675 1672
1676 } // namespace internal 1673 } // namespace internal
1677 } // namespace v8 1674 } // namespace v8
1678 #endif // V8_CODE_STUB_ASSEMBLER_H_ 1675 #endif // V8_CODE_STUB_ASSEMBLER_H_
OLDNEW
« 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