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_API_ARGUMENTS_H_ | 5 #ifndef V8_API_ARGUMENTS_H_ |
6 #define V8_API_ARGUMENTS_H_ | 6 #define V8_API_ARGUMENTS_H_ |
7 | 7 |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/tracing/trace-event.h" | 10 #include "src/tracing/trace-event.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 typedef FunctionCallbackInfo<Value> T; | 199 typedef FunctionCallbackInfo<Value> T; |
200 typedef CustomArguments<T> Super; | 200 typedef CustomArguments<T> Super; |
201 static const int kArgsLength = T::kArgsLength; | 201 static const int kArgsLength = T::kArgsLength; |
202 static const int kHolderIndex = T::kHolderIndex; | 202 static const int kHolderIndex = T::kHolderIndex; |
203 static const int kDataIndex = T::kDataIndex; | 203 static const int kDataIndex = T::kDataIndex; |
204 static const int kReturnValueDefaultValueIndex = | 204 static const int kReturnValueDefaultValueIndex = |
205 T::kReturnValueDefaultValueIndex; | 205 T::kReturnValueDefaultValueIndex; |
206 static const int kIsolateIndex = T::kIsolateIndex; | 206 static const int kIsolateIndex = T::kIsolateIndex; |
207 static const int kCalleeIndex = T::kCalleeIndex; | 207 static const int kCalleeIndex = T::kCalleeIndex; |
208 static const int kContextSaveIndex = T::kContextSaveIndex; | 208 static const int kContextSaveIndex = T::kContextSaveIndex; |
| 209 static const int kNewTargetIndex = T::kNewTargetIndex; |
209 | 210 |
210 FunctionCallbackArguments(internal::Isolate* isolate, internal::Object* data, | 211 FunctionCallbackArguments(internal::Isolate* isolate, internal::Object* data, |
211 internal::HeapObject* callee, | 212 internal::HeapObject* callee, |
212 internal::Object* holder, internal::Object** argv, | 213 internal::Object* holder, |
213 int argc, bool is_construct_call) | 214 internal::HeapObject* new_target, |
| 215 internal::Object** argv, int argc, |
| 216 bool is_construct_call) |
214 : Super(isolate), | 217 : Super(isolate), |
215 argv_(argv), | 218 argv_(argv), |
216 argc_(argc), | 219 argc_(argc), |
217 is_construct_call_(is_construct_call) { | 220 is_construct_call_(is_construct_call) { |
218 Object** values = begin(); | 221 Object** values = begin(); |
219 values[T::kDataIndex] = data; | 222 values[T::kDataIndex] = data; |
220 values[T::kCalleeIndex] = callee; | 223 values[T::kCalleeIndex] = callee; |
221 values[T::kHolderIndex] = holder; | 224 values[T::kHolderIndex] = holder; |
| 225 values[T::kNewTargetIndex] = new_target; |
222 values[T::kContextSaveIndex] = isolate->heap()->the_hole_value(); | 226 values[T::kContextSaveIndex] = isolate->heap()->the_hole_value(); |
223 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate); | 227 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate); |
224 // Here the hole is set as default value. | 228 // Here the hole is set as default value. |
225 // It cannot escape into js as it's remove in Call below. | 229 // It cannot escape into js as it's remove in Call below. |
226 values[T::kReturnValueDefaultValueIndex] = | 230 values[T::kReturnValueDefaultValueIndex] = |
227 isolate->heap()->the_hole_value(); | 231 isolate->heap()->the_hole_value(); |
228 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); | 232 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); |
229 DCHECK(values[T::kCalleeIndex]->IsJSFunction() || | 233 DCHECK(values[T::kCalleeIndex]->IsJSFunction() || |
230 values[T::kCalleeIndex]->IsFunctionTemplateInfo()); | 234 values[T::kCalleeIndex]->IsFunctionTemplateInfo()); |
231 DCHECK(values[T::kHolderIndex]->IsHeapObject()); | 235 DCHECK(values[T::kHolderIndex]->IsHeapObject()); |
(...skipping 13 matching lines...) Expand all Loading... |
245 private: | 249 private: |
246 internal::Object** argv_; | 250 internal::Object** argv_; |
247 int argc_; | 251 int argc_; |
248 bool is_construct_call_; | 252 bool is_construct_call_; |
249 }; | 253 }; |
250 | 254 |
251 } // namespace internal | 255 } // namespace internal |
252 } // namespace v8 | 256 } // namespace v8 |
253 | 257 |
254 #endif // V8_API_ARGUMENTS_H_ | 258 #endif // V8_API_ARGUMENTS_H_ |
OLD | NEW |