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

Side by Side Diff: src/builtins/builtins-utils.h

Issue 2647493002: [ic] Clean up handler boilerplate (Closed)
Patch Set: rebased Created 3 years, 11 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 | « src/builtins/builtins-ic.cc ('k') | src/code-factory.h » ('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_BUILTINS_BUILTINS_UTILS_H_ 5 #ifndef V8_BUILTINS_BUILTINS_UTILS_H_
6 #define V8_BUILTINS_BUILTINS_UTILS_H_ 6 #define V8_BUILTINS_BUILTINS_UTILS_H_
7 7
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/base/logging.h" 9 #include "src/base/logging.h"
10 #include "src/builtins/builtins.h" 10 #include "src/builtins/builtins.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // ... 114 // ...
115 // } 115 // }
116 // 116 //
117 // In the body of the builtin function the arguments can be accessed 117 // In the body of the builtin function the arguments can be accessed
118 // as "Parameter(n)". 118 // as "Parameter(n)".
119 #define TF_BUILTIN(Name, AssemblerBase) \ 119 #define TF_BUILTIN(Name, AssemblerBase) \
120 class Name##Assembler : public AssemblerBase { \ 120 class Name##Assembler : public AssemblerBase { \
121 public: \ 121 public: \
122 explicit Name##Assembler(compiler::CodeAssemblerState* state) \ 122 explicit Name##Assembler(compiler::CodeAssemblerState* state) \
123 : AssemblerBase(state) {} \ 123 : AssemblerBase(state) {} \
124 void Generate##NameImpl(); \ 124 void Generate##Name##Impl(); \
125 }; \ 125 }; \
126 void Builtins::Generate_##Name(compiler::CodeAssemblerState* state) { \ 126 void Builtins::Generate_##Name(compiler::CodeAssemblerState* state) { \
127 Name##Assembler assembler(state); \ 127 Name##Assembler assembler(state); \
128 assembler.Generate##NameImpl(); \ 128 assembler.Generate##Name##Impl(); \
129 } \ 129 } \
130 void Name##Assembler::Generate##NameImpl() 130 void Name##Assembler::Generate##Name##Impl()
131 131
132 // ---------------------------------------------------------------------------- 132 // ----------------------------------------------------------------------------
133 133
134 #define CHECK_RECEIVER(Type, name, method) \ 134 #define CHECK_RECEIVER(Type, name, method) \
135 if (!args.receiver()->Is##Type()) { \ 135 if (!args.receiver()->Is##Type()) { \
136 THROW_NEW_ERROR_RETURN_FAILURE( \ 136 THROW_NEW_ERROR_RETURN_FAILURE( \
137 isolate, \ 137 isolate, \
138 NewTypeError(MessageTemplate::kIncompatibleMethodReceiver, \ 138 NewTypeError(MessageTemplate::kIncompatibleMethodReceiver, \
139 isolate->factory()->NewStringFromAsciiChecked(method), \ 139 isolate->factory()->NewStringFromAsciiChecked(method), \
140 args.receiver())); \ 140 args.receiver())); \
(...skipping 11 matching lines...) Expand all
152 isolate->factory()->NewStringFromAsciiChecked(method))); \ 152 isolate->factory()->NewStringFromAsciiChecked(method))); \
153 } \ 153 } \
154 Handle<String> name; \ 154 Handle<String> name; \
155 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \ 155 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \
156 isolate, name, Object::ToString(isolate, args.receiver())) 156 isolate, name, Object::ToString(isolate, args.receiver()))
157 157
158 } // namespace internal 158 } // namespace internal
159 } // namespace v8 159 } // namespace v8
160 160
161 #endif // V8_BUILTINS_BUILTINS_UTILS_H_ 161 #endif // V8_BUILTINS_BUILTINS_UTILS_H_
OLDNEW
« no previous file with comments | « src/builtins/builtins-ic.cc ('k') | src/code-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698