Chromium Code Reviews| Index: vm/runtime_entry.h |
| =================================================================== |
| --- vm/runtime_entry.h (revision 8520) |
| +++ vm/runtime_entry.h (working copy) |
| @@ -22,15 +22,18 @@ |
| // by the function. |
| class RuntimeEntry : public ValueObject { |
| public: |
| - RuntimeEntry(const char* name, RuntimeFunction function, int argument_count) |
| + RuntimeEntry(const char* name, RuntimeFunction function, |
| + int argument_count, bool is_leaf) |
| : name_(name), |
| function_(function), |
| - argument_count_(argument_count) { } |
| + argument_count_(argument_count), |
| + is_leaf_(is_leaf) { } |
| ~RuntimeEntry() {} |
| const char* name() const { return name_; } |
| RuntimeFunction function() const { return function_; } |
| int argument_count() const { return argument_count_; } |
| + bool is_leaf() const { return is_leaf_; } |
| uword GetEntryPoint() const { return reinterpret_cast<uword>(function()); } |
| // Generate code to call the runtime entry. |
| @@ -40,6 +43,7 @@ |
| const char* name_; |
| RuntimeFunction function_; |
| int argument_count_; |
|
srdjan
2012/06/12 20:10:41
const
siva
2012/06/12 21:18:04
Done.
|
| + bool is_leaf_; |
|
srdjan
2012/06/12 20:10:41
const
siva
2012/06/12 21:18:04
Done.
|
| DISALLOW_COPY_AND_ASSIGN(RuntimeEntry); |
| }; |
| @@ -50,7 +54,7 @@ |
| #define DEFINE_RUNTIME_ENTRY(name, argument_count) \ |
| extern void DRT_##name(NativeArguments arguments); \ |
| extern const RuntimeEntry k##name##RuntimeEntry( \ |
| - "DRT_"#name, &DRT_##name, argument_count); \ |
| + "DRT_"#name, &DRT_##name, argument_count, false); \ |
| static void DRT_Helper##name(Isolate* isolate, NativeArguments arguments); \ |
| void DRT_##name(NativeArguments arguments) { \ |
| CHECK_STACK_ALIGNMENT; \ |
| @@ -68,6 +72,24 @@ |
| #define DECLARE_RUNTIME_ENTRY(name) \ |
| extern const RuntimeEntry k##name##RuntimeEntry |
| +#define DEFINE_LEAF_RUNTIME_ENTRY(name, argument_count) \ |
| + extern RawObject* DLRT_##name(NativeArguments arguments); \ |
| + extern const RuntimeEntry k##name##RuntimeEntry( \ |
| + "DLRT_"#name, reinterpret_cast<RuntimeFunction>(&DLRT_##name), \ |
| + argument_count, true); \ |
| + static RawObject* DLRT_Helper##name(Isolate* isolate, NativeArguments args); \ |
| + RawObject* DLRT_##name(NativeArguments arguments) { \ |
| + CHECK_STACK_ALIGNMENT; \ |
| + { \ |
| + NoGCScope no_gc_scope; \ |
| + return DLRT_Helper##name(arguments.isolate(), arguments); \ |
| + } \ |
| + } \ |
| + static RawObject* DLRT_Helper##name(Isolate* isolate, NativeArguments args) |
| + |
| +#define DECLARE_LEAF_RUNTIME_ENTRY(name) \ |
| + extern const RuntimeEntry k##name##RuntimeEntry |
| + |
| } // namespace dart |
| #endif // VM_RUNTIME_ENTRY_H_ |