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 26 matching lines...) Expand all Loading... |
37 V(TrueValue, True) \ | 37 V(TrueValue, True) \ |
38 V(UndefinedValue, Undefined) | 38 V(UndefinedValue, Undefined) |
39 | 39 |
40 // Provides JavaScript-specific "macro-assembler" functionality on top of the | 40 // Provides JavaScript-specific "macro-assembler" functionality on top of the |
41 // CodeAssembler. By factoring the JavaScript-isms out of the CodeAssembler, | 41 // CodeAssembler. By factoring the JavaScript-isms out of the CodeAssembler, |
42 // it's possible to add JavaScript-specific useful CodeAssembler "macros" | 42 // it's possible to add JavaScript-specific useful CodeAssembler "macros" |
43 // without modifying files in the compiler directory (and requiring a review | 43 // without modifying files in the compiler directory (and requiring a review |
44 // from a compiler directory OWNER). | 44 // from a compiler directory OWNER). |
45 class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { | 45 class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
46 public: | 46 public: |
47 CodeStubAssembler(compiler::CodeAssemblerState* state) | 47 // Create with CallStub linkage. |
48 : compiler::CodeAssembler(state) {} | 48 // |result_size| specifies the number of results returned by the stub. |
| 49 // TODO(rmcilroy): move result_size to the CallInterfaceDescriptor. |
| 50 CodeStubAssembler(Isolate* isolate, Zone* zone, |
| 51 const CallInterfaceDescriptor& descriptor, |
| 52 Code::Flags flags, const char* name, |
| 53 size_t result_size = 1); |
| 54 |
| 55 // Create with JSCall linkage. |
| 56 CodeStubAssembler(Isolate* isolate, Zone* zone, int parameter_count, |
| 57 Code::Flags flags, const char* name); |
49 | 58 |
50 enum AllocationFlag : uint8_t { | 59 enum AllocationFlag : uint8_t { |
51 kNone = 0, | 60 kNone = 0, |
52 kDoubleAlignment = 1, | 61 kDoubleAlignment = 1, |
53 kPretenured = 1 << 1 | 62 kPretenured = 1 << 1 |
54 }; | 63 }; |
55 | 64 |
56 typedef base::Flags<AllocationFlag> AllocationFlags; | 65 typedef base::Flags<AllocationFlag> AllocationFlags; |
57 | 66 |
58 // TODO(ishell): Fix all loads/stores from arrays by int32 offsets/indices | 67 // TODO(ishell): Fix all loads/stores from arrays by int32 offsets/indices |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 } | 1311 } |
1303 #else | 1312 #else |
1304 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1313 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1305 #endif | 1314 #endif |
1306 | 1315 |
1307 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1316 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1308 | 1317 |
1309 } // namespace internal | 1318 } // namespace internal |
1310 } // namespace v8 | 1319 } // namespace v8 |
1311 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1320 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |