OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 #undef WRITE_CALL_2_VOID | 230 #undef WRITE_CALL_2_VOID |
231 }; | 231 }; |
232 | 232 |
233 | 233 |
234 class FunctionCallbackArguments | 234 class FunctionCallbackArguments |
235 : public CustomArguments<FunctionCallbackInfo<Value> > { | 235 : public CustomArguments<FunctionCallbackInfo<Value> > { |
236 public: | 236 public: |
237 typedef FunctionCallbackInfo<Value> T; | 237 typedef FunctionCallbackInfo<Value> T; |
238 typedef CustomArguments<T> Super; | 238 typedef CustomArguments<T> Super; |
239 static const int kArgsLength = T::kArgsLength; | 239 static const int kArgsLength = T::kArgsLength; |
240 static const int kHolderIndex = T::kHolderIndex; | |
241 | 240 |
242 FunctionCallbackArguments(internal::Isolate* isolate, | 241 FunctionCallbackArguments(internal::Isolate* isolate, |
243 internal::Object* data, | 242 internal::Object* data, |
244 internal::JSFunction* callee, | 243 internal::JSFunction* callee, |
245 internal::Object* holder, | 244 internal::Object* holder, |
246 internal::Object** argv, | 245 internal::Object** argv, |
247 int argc, | 246 int argc, |
248 bool is_construct_call) | 247 bool is_construct_call) |
249 : Super(isolate), | 248 : Super(isolate), |
250 argv_(argv), | 249 argv_(argv), |
251 argc_(argc), | 250 argc_(argc), |
252 is_construct_call_(is_construct_call) { | 251 is_construct_call_(is_construct_call) { |
253 Object** values = end(); | 252 Object** values = end(); |
254 values[T::kDataIndex] = data; | 253 values[T::kDataIndex] = data; |
255 values[T::kCalleeIndex] = callee; | 254 values[T::kCalleeIndex] = callee; |
256 values[T::kHolderIndex] = holder; | 255 values[T::kHolderIndex] = holder; |
257 values[T::kContextSaveIndex] = isolate->heap()->the_hole_value(); | |
258 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate); | 256 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate); |
259 // Here the hole is set as default value. | 257 // Here the hole is set as default value. |
260 // It cannot escape into js as it's remove in Call below. | 258 // It cannot escape into js as it's remove in Call below. |
261 values[T::kReturnValueDefaultValueIndex] = | 259 values[T::kReturnValueDefaultValueIndex] = |
262 isolate->heap()->the_hole_value(); | 260 isolate->heap()->the_hole_value(); |
263 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); | 261 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); |
264 ASSERT(values[T::kCalleeIndex]->IsJSFunction()); | 262 ASSERT(values[T::kCalleeIndex]->IsJSFunction()); |
265 ASSERT(values[T::kHolderIndex]->IsHeapObject()); | 263 ASSERT(values[T::kHolderIndex]->IsHeapObject()); |
266 ASSERT(values[T::kIsolateIndex]->IsSmi()); | 264 ASSERT(values[T::kIsolateIndex]->IsSmi()); |
267 } | 265 } |
(...skipping 25 matching lines...) Expand all Loading... |
293 return __RT_impl_##Name(args, isolate); \ | 291 return __RT_impl_##Name(args, isolate); \ |
294 } \ | 292 } \ |
295 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) | 293 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) |
296 | 294 |
297 #define RUNTIME_ARGUMENTS(isolate, args) \ | 295 #define RUNTIME_ARGUMENTS(isolate, args) \ |
298 args.length(), args.arguments(), isolate | 296 args.length(), args.arguments(), isolate |
299 | 297 |
300 } } // namespace v8::internal | 298 } } // namespace v8::internal |
301 | 299 |
302 #endif // V8_ARGUMENTS_H_ | 300 #endif // V8_ARGUMENTS_H_ |
OLD | NEW |