OLD | NEW |
---|---|
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 10 matching lines...) Expand all Loading... | |
21 | 21 |
22 enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol }; | 22 enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol }; |
23 | 23 |
24 #define HEAP_CONSTANT_LIST(V) \ | 24 #define HEAP_CONSTANT_LIST(V) \ |
25 V(AccessorInfoMap, AccessorInfoMap) \ | 25 V(AccessorInfoMap, AccessorInfoMap) \ |
26 V(AllocationSiteMap, AllocationSiteMap) \ | 26 V(AllocationSiteMap, AllocationSiteMap) \ |
27 V(BooleanMap, BooleanMap) \ | 27 V(BooleanMap, BooleanMap) \ |
28 V(CodeMap, CodeMap) \ | 28 V(CodeMap, CodeMap) \ |
29 V(empty_string, EmptyString) \ | 29 V(empty_string, EmptyString) \ |
30 V(EmptyFixedArray, EmptyFixedArray) \ | 30 V(EmptyFixedArray, EmptyFixedArray) \ |
31 V(EmptyLiteralsArray, EmptyLiteralsArray) \ | |
31 V(FalseValue, False) \ | 32 V(FalseValue, False) \ |
32 V(FixedArrayMap, FixedArrayMap) \ | 33 V(FixedArrayMap, FixedArrayMap) \ |
33 V(FixedCOWArrayMap, FixedCOWArrayMap) \ | 34 V(FixedCOWArrayMap, FixedCOWArrayMap) \ |
34 V(FixedDoubleArrayMap, FixedDoubleArrayMap) \ | 35 V(FixedDoubleArrayMap, FixedDoubleArrayMap) \ |
35 V(FunctionTemplateInfoMap, FunctionTemplateInfoMap) \ | 36 V(FunctionTemplateInfoMap, FunctionTemplateInfoMap) \ |
36 V(HeapNumberMap, HeapNumberMap) \ | 37 V(HeapNumberMap, HeapNumberMap) \ |
37 V(MinusZeroValue, MinusZero) \ | 38 V(MinusZeroValue, MinusZero) \ |
38 V(NanValue, Nan) \ | 39 V(NanValue, Nan) \ |
39 V(NullValue, Null) \ | 40 V(NullValue, Null) \ |
40 V(SymbolMap, SymbolMap) \ | 41 V(SymbolMap, SymbolMap) \ |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1197 | 1198 |
1198 CodeStubAssembler* assembler_; | 1199 CodeStubAssembler* assembler_; |
1199 Node* argc_; | 1200 Node* argc_; |
1200 Node* arguments_; | 1201 Node* arguments_; |
1201 Node* fp_; | 1202 Node* fp_; |
1202 }; | 1203 }; |
1203 | 1204 |
1204 #ifdef DEBUG | 1205 #ifdef DEBUG |
1205 #define CSA_ASSERT(csa, x) \ | 1206 #define CSA_ASSERT(csa, x) \ |
1206 (csa)->Assert([&] { return (x); }, #x, __FILE__, __LINE__) | 1207 (csa)->Assert([&] { return (x); }, #x, __FILE__, __LINE__) |
1208 #define CSA_ASSERT_JS_ARGC_OP(csa, Op, op, expected) \ | |
1209 (csa)->Assert( \ | |
1210 [&] { \ | |
1211 const CodeAssemblerState* state = (csa)->state(); \ | |
1212 int argc_index = state->parameter_count() - 2; \ | |
Igor Sheludko
2016/12/21 12:00:45
Please add a comment:
// See Linkage::GetJSCallD
| |
1213 compiler::Node* const argc = (csa)->Parameter(argc_index); \ | |
1214 return (csa)->Op(argc, (csa)->Int32Constant(expected)); \ | |
1215 }, \ | |
1216 "argc " #op " " #expected, __FILE__, __LINE__) | |
1217 | |
1218 #define CSA_ASSERT_JS_ARGC_EQ(csa, expected) \ | |
1219 CSA_ASSERT_JS_ARGC_OP(csa, Word32Equal, ==, expected) | |
1220 | |
1207 #else | 1221 #else |
1208 #define CSA_ASSERT(csa, x) ((void)0) | 1222 #define CSA_ASSERT(csa, x) ((void)0) |
1223 #define CSA_ASSERT_JS_ARGC_EQ(csa, expected) ((void)0) | |
1209 #endif | 1224 #endif |
1210 | 1225 |
1211 #ifdef ENABLE_SLOW_DCHECKS | 1226 #ifdef ENABLE_SLOW_DCHECKS |
1212 #define CSA_SLOW_ASSERT(csa, x) \ | 1227 #define CSA_SLOW_ASSERT(csa, x) \ |
1213 if (FLAG_enable_slow_asserts) { \ | 1228 if (FLAG_enable_slow_asserts) { \ |
1214 (csa)->Assert([&] { return (x); }, #x, __FILE__, __LINE__); \ | 1229 (csa)->Assert([&] { return (x); }, #x, __FILE__, __LINE__); \ |
1215 } | 1230 } |
1216 #else | 1231 #else |
1217 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1232 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1218 #endif | 1233 #endif |
1219 | 1234 |
1220 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1235 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1221 | 1236 |
1222 } // namespace internal | 1237 } // namespace internal |
1223 } // namespace v8 | 1238 } // namespace v8 |
1224 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1239 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |