5 #ifndef V8_ARGUMENTS_H_
6 #define V8_ARGUMENTS_H_
32 : length_(length), arguments_(arguments) { }
35 DCHECK(0 <= index && index < length_);
36 return *(
reinterpret_cast<Object**
>(
reinterpret_cast<intptr_t
>(arguments_) -
41 Object** value = &((*this)[index]);
45 return Handle<S>(
reinterpret_cast<S**
>(value));
49 return Smi::cast((*
this)[index])->value();
53 return (*
this)[index]->Number();
57 int length()
const {
return static_cast<int>(length_); }
72 #define FOR_EACH_CALLBACK_TABLE_MAPPING_0(F) \
73 F(IndexedPropertyEnumeratorCallback, v8::Array) \
75 #define FOR_EACH_CALLBACK_TABLE_MAPPING_1(F) \
76 F(NamedPropertyGetterCallback, v8::Value, v8::Local<v8::String>) \
77 F(AccessorNameGetterCallback, v8::Value, v8::Local<v8::Name>) \
78 F(NamedPropertyQueryCallback, \
80 v8::Local<v8::String>) \
81 F(NamedPropertyDeleterCallback, \
83 v8::Local<v8::String>) \
84 F(IndexedPropertyGetterCallback, \
87 F(IndexedPropertyQueryCallback, \
90 F(IndexedPropertyDeleterCallback, \
94 #define FOR_EACH_CALLBACK_TABLE_MAPPING_2(F) \
95 F(NamedPropertySetterCallback, \
97 v8::Local<v8::String>, \
98 v8::Local<v8::Value>) \
99 F(IndexedPropertySetterCallback, \
102 v8::Local<v8::Value>) \
104 #define FOR_EACH_CALLBACK_TABLE_MAPPING_2_VOID_RETURN(F) \
105 F(AccessorNameSetterCallback, \
107 v8::Local<v8::Name>, \
108 v8::Local<v8::Value>) \
114 template<
int kArrayLength>
123 : Relocatable(isolate) {}
146 return reinterpret_cast<Isolate*
>(this->
begin()[T::kIsolateIndex]);
191 #define WRITE_CALL_0(Function, ReturnValue) \
192 v8::Handle<ReturnValue> Call(Function f); \
194 #define WRITE_CALL_1(Function, ReturnValue, Arg1) \
195 v8::Handle<ReturnValue> Call(Function f, Arg1 arg1); \
197 #define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
198 v8::Handle<ReturnValue> Call(Function f, Arg1 arg1, Arg2 arg2); \
200 #define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2) \
201 void Call(Function f, Arg1 arg1, Arg2 arg2); \
211 #undef WRITE_CALL_2_VOID
235 bool is_construct_call)
277 #define CLOBBER_DOUBLE_REGISTERS() ClobberDoubleRegisters(1, 2, 3, 4);
279 #define CLOBBER_DOUBLE_REGISTERS()
283 #define DECLARE_RUNTIME_FUNCTION(Name) \
284 Object* Name(int args_length, Object** args_object, Isolate* isolate)
286 #define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \
287 static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \
288 Type Name(int args_length, Object** args_object, Isolate* isolate) { \
289 CLOBBER_DOUBLE_REGISTERS(); \
290 Arguments args(args_length, args_object); \
291 return __RT_impl_##Name(args, isolate); \
293 static Type __RT_impl_##Name(Arguments args, Isolate* isolate)
296 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name)
297 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \
298 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name)
300 #define RUNTIME_ARGUMENTS(isolate, args) \
301 args.length(), args.arguments(), isolate
#define WRITE_CALL_0(Function, ReturnValue)
#define WRITE_CALL_1(Function, ReturnValue, Arg1)
#define FOR_EACH_CALLBACK_TABLE_MAPPING_2(F)
#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2)
#define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2)
#define FOR_EACH_CALLBACK_TABLE_MAPPING_2_VOID_RETURN(F)
#define FOR_EACH_CALLBACK_TABLE_MAPPING_0(F)
#define FOR_EACH_CALLBACK_TABLE_MAPPING_1(F)
The argument information given to function call callbacks.
static const int kHolderIndex
static const int kCalleeIndex
static const int kReturnValueDefaultValueIndex
static const int kIsolateIndex
static const int kDataIndex
static const int kArgsLength
static const int kContextSaveIndex
static const int kReturnValueIndex
An object reference managed by the v8 garbage collector.
The information passed to a property callback about the context of the property access.
static const int kReturnValueDefaultValueIndex
static const int kDataIndex
static const int kIsolateIndex
static const int kThisIndex
static const int kHolderIndex
static const int kArgsLength
static const int kReturnValueIndex
Handle< S > at(int index)
double number_at(int index)
Arguments(int length, Object **arguments)
Object * values_[kArrayLength]
virtual void IterateInstance(ObjectVisitor *v)
CustomArgumentsBase(Isolate *isolate)
CustomArguments(Isolate *isolate)
static const int kReturnValueOffset
CustomArgumentsBase< T::kArgsLength > Super
v8::Handle< V > GetReturnValue(Isolate *isolate)
static const int kCalleeIndex
static const int kDataIndex
static const int kIsolateIndex
static const int kHolderIndex
static const int kArgsLength
FunctionCallbackInfo< Value > T
CustomArguments< T > Super
FunctionCallbackArguments(internal::Isolate *isolate, internal::Object *data, internal::JSFunction *callee, internal::Object *holder, internal::Object **argv, int argc, bool is_construct_call)
v8::Handle< v8::Value > Call(FunctionCallback f)
internal::Object ** argv_
static const int kContextSaveIndex
static const int kReturnValueDefaultValueIndex
static const int kArgsLength
PropertyCallbackArguments(Isolate *isolate, Object *data, Object *self, JSObject *holder)
PropertyCallbackInfo< Value > T
static const int kHolderIndex
static const int kDataIndex
static const int kIsolateIndex
CustomArguments< T > Super
static const int kThisIndex
static const int kReturnValueDefaultValueIndex
#define DCHECK(condition)
double ClobberDoubleRegisters(double x1, double x2, double x3, double x4)
const Address kHandleZapValue
Debugger support for the V8 JavaScript engine.
void(* FunctionCallback)(const FunctionCallbackInfo< Value > &info)