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

Side by Side Diff: src/arguments.h

Issue 1520843002: Revert of Removes the Callee parameter from FunctionCallbackInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « include/v8.h ('k') | src/arm/code-stubs-arm.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARGUMENTS_H_ 5 #ifndef V8_ARGUMENTS_H_
6 #define V8_ARGUMENTS_H_ 6 #define V8_ARGUMENTS_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 10
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 : public CustomArguments<FunctionCallbackInfo<Value> > { 208 : public CustomArguments<FunctionCallbackInfo<Value> > {
209 public: 209 public:
210 typedef FunctionCallbackInfo<Value> T; 210 typedef FunctionCallbackInfo<Value> T;
211 typedef CustomArguments<T> Super; 211 typedef CustomArguments<T> Super;
212 static const int kArgsLength = T::kArgsLength; 212 static const int kArgsLength = T::kArgsLength;
213 static const int kHolderIndex = T::kHolderIndex; 213 static const int kHolderIndex = T::kHolderIndex;
214 static const int kDataIndex = T::kDataIndex; 214 static const int kDataIndex = T::kDataIndex;
215 static const int kReturnValueDefaultValueIndex = 215 static const int kReturnValueDefaultValueIndex =
216 T::kReturnValueDefaultValueIndex; 216 T::kReturnValueDefaultValueIndex;
217 static const int kIsolateIndex = T::kIsolateIndex; 217 static const int kIsolateIndex = T::kIsolateIndex;
218 static const int kCalleeIndex = T::kCalleeIndex;
218 static const int kContextSaveIndex = T::kContextSaveIndex; 219 static const int kContextSaveIndex = T::kContextSaveIndex;
219 220
220 FunctionCallbackArguments(internal::Isolate* isolate, 221 FunctionCallbackArguments(internal::Isolate* isolate,
221 internal::Object* data, 222 internal::Object* data,
223 internal::JSFunction* callee,
222 internal::Object* holder, 224 internal::Object* holder,
223 internal::Object** argv, 225 internal::Object** argv,
224 int argc, 226 int argc,
225 bool is_construct_call) 227 bool is_construct_call)
226 : Super(isolate), 228 : Super(isolate),
227 argv_(argv), 229 argv_(argv),
228 argc_(argc), 230 argc_(argc),
229 is_construct_call_(is_construct_call) { 231 is_construct_call_(is_construct_call) {
230 Object** values = begin(); 232 Object** values = begin();
231 values[T::kDataIndex] = data; 233 values[T::kDataIndex] = data;
234 values[T::kCalleeIndex] = callee;
232 values[T::kHolderIndex] = holder; 235 values[T::kHolderIndex] = holder;
233 values[T::kContextSaveIndex] = isolate->heap()->the_hole_value(); 236 values[T::kContextSaveIndex] = isolate->heap()->the_hole_value();
234 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate); 237 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate);
235 // Here the hole is set as default value. 238 // Here the hole is set as default value.
236 // It cannot escape into js as it's remove in Call below. 239 // It cannot escape into js as it's remove in Call below.
237 values[T::kReturnValueDefaultValueIndex] = 240 values[T::kReturnValueDefaultValueIndex] =
238 isolate->heap()->the_hole_value(); 241 isolate->heap()->the_hole_value();
239 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); 242 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value();
243 DCHECK(values[T::kCalleeIndex]->IsJSFunction());
240 DCHECK(values[T::kHolderIndex]->IsHeapObject()); 244 DCHECK(values[T::kHolderIndex]->IsHeapObject());
241 DCHECK(values[T::kIsolateIndex]->IsSmi()); 245 DCHECK(values[T::kIsolateIndex]->IsSmi());
242 } 246 }
243 247
244 /* 248 /*
245 * The following Call function wraps the calling of all callbacks to handle 249 * The following Call function wraps the calling of all callbacks to handle
246 * calling either the old or the new style callbacks depending on which one 250 * calling either the old or the new style callbacks depending on which one
247 * has been registered. 251 * has been registered.
248 * For old callbacks which return an empty handle, the ReturnValue is checked 252 * For old callbacks which return an empty handle, the ReturnValue is checked
249 * and used if it's been set to anything inside the callback. 253 * and used if it's been set to anything inside the callback.
(...skipping 29 matching lines...) Expand all
279 283
280 284
281 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) 285 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name)
282 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ 286 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \
283 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) 287 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name)
284 288
285 } // namespace internal 289 } // namespace internal
286 } // namespace v8 290 } // namespace v8
287 291
288 #endif // V8_ARGUMENTS_H_ 292 #endif // V8_ARGUMENTS_H_
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698