28 #ifndef V8_ARGUMENTS_H_
29 #define V8_ARGUMENTS_H_
51 : length_(length), arguments_(arguments) { }
54 ASSERT(0 <= index && index < length_);
55 return *(
reinterpret_cast<Object**
>(
reinterpret_cast<intptr_t
>(arguments_) -
60 Object** value = &((*this)[index]);
64 return Handle<S>(
reinterpret_cast<S**
>(value));
72 return (*
this)[index]->Number();
76 int length()
const {
return length_; }
92 #define FOR_EACH_CALLBACK_TABLE_MAPPING_0(F) \
93 F(IndexedPropertyEnumeratorCallback, v8::Array) \
95 #define FOR_EACH_CALLBACK_TABLE_MAPPING_1(F) \
96 F(AccessorGetterCallback, v8::Value, v8::Local<v8::String>) \
97 F(NamedPropertyQueryCallback, \
99 v8::Local<v8::String>) \
100 F(NamedPropertyDeleterCallback, \
102 v8::Local<v8::String>) \
103 F(IndexedPropertyGetterCallback, \
106 F(IndexedPropertyQueryCallback, \
109 F(IndexedPropertyDeleterCallback, \
113 #define FOR_EACH_CALLBACK_TABLE_MAPPING_2(F) \
114 F(NamedPropertySetterCallback, \
116 v8::Local<v8::String>, \
117 v8::Local<v8::Value>) \
118 F(IndexedPropertySetterCallback, \
121 v8::Local<v8::Value>) \
123 #define FOR_EACH_CALLBACK_TABLE_MAPPING_2_VOID_RETURN(F) \
124 F(AccessorSetterCallback, \
126 v8::Local<v8::String>, \
127 v8::Local<v8::Value>) \
133 template<
int kArrayLength>
142 : Relocatable(isolate) {}
165 return reinterpret_cast<Isolate*
>(this->
begin()[T::kIsolateIndex]);
196 isolate->
heap()->the_hole_value();
210 #define WRITE_CALL_0(Function, ReturnValue) \
211 v8::Handle<ReturnValue> Call(Function f); \
213 #define WRITE_CALL_1(Function, ReturnValue, Arg1) \
214 v8::Handle<ReturnValue> Call(Function f, Arg1 arg1); \
216 #define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
217 v8::Handle<ReturnValue> Call(Function f, Arg1 arg1, Arg2 arg2); \
219 #define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2) \
220 void Call(Function f, Arg1 arg1, Arg2 arg2); \
230 #undef WRITE_CALL_2_VOID
254 bool is_construct_call)
258 is_construct_call_(is_construct_call) {
268 isolate->
heap()->the_hole_value();
288 bool is_construct_call_;
296 #define CLOBBER_DOUBLE_REGISTERS() ClobberDoubleRegisters(1, 2, 3, 4);
298 #define CLOBBER_DOUBLE_REGISTERS()
302 #define DECLARE_RUNTIME_FUNCTION(Type, Name) \
303 Type Name(int args_length, Object** args_object, Isolate* isolate)
305 #define RUNTIME_FUNCTION(Type, Name) \
306 static Type __RT_impl_##Name(Arguments args, Isolate* isolate); \
307 Type Name(int args_length, Object** args_object, Isolate* isolate) { \
308 CLOBBER_DOUBLE_REGISTERS(); \
309 Arguments args(args_length, args_object); \
310 return __RT_impl_##Name(args, isolate); \
312 static Type __RT_impl_##Name(Arguments args, Isolate* isolate)
314 #define RUNTIME_ARGUMENTS(isolate, args) \
315 args.length(), args.arguments(), isolate
319 #endif // V8_ARGUMENTS_H_
static const int kThisIndex
static const int kArgsLength
#define FOR_EACH_CALLBACK_TABLE_MAPPING_0(F)
static const int kIsolateIndex
#define FOR_EACH_CALLBACK_TABLE_MAPPING_2_VOID_RETURN(F)
FunctionCallbackArguments(internal::Isolate *isolate, internal::Object *data, internal::JSFunction *callee, internal::Object *holder, internal::Object **argv, int argc, bool is_construct_call)
static const int kReturnValueOffset
void(* FunctionCallback)(const FunctionCallbackInfo< Value > &info)
static const int kCalleeIndex
static const int kArgsLength
#define WRITE_CALL_0(Function, ReturnValue)
static const int kHolderIndex
static const int kDataIndex
static const int kHolderIndex
CustomArguments(Isolate *isolate)
Handle< S > at(int index)
CustomArguments< T > Super
#define ASSERT(condition)
#define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2)
static const int kArgsLength
v8::Handle< V > GetReturnValue(Isolate *isolate)
static Smi * cast(Object *object)
PropertyCallbackArguments(Isolate *isolate, Object *data, Object *self, JSObject *holder)
static const int kDataIndex
static const int kContextSaveIndex
FunctionCallbackInfo< Value > T
static const int kReturnValueDefaultValueIndex
static const int kReturnValueIndex
Arguments(int length, Object **arguments)
double ClobberDoubleRegisters(double x1, double x2, double x3, double x4)
static const int kReturnValueDefaultValueIndex
static const int kReturnValueDefaultValueIndex
static const int kIsolateIndex
static const int kHolderIndex
static const int kIsolateIndex
static const int kReturnValueDefaultValueIndex
static const int kCalleeIndex
CustomArgumentsBase(Isolate *isolate)
#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2)
static const int kDataIndex
static const int kIsolateIndex
CustomArguments< T > Super
CustomArgumentsBase< T::kArgsLength > Super
Object * values_[kArrayLength]
static const int kThisIndex
PropertyCallbackInfo< Value > T
v8::Handle< v8::Value > Call(FunctionCallback f)
static const int kHolderIndex
double number_at(int index)
#define WRITE_CALL_1(Function, ReturnValue, Arg1)
static const int kArgsLength
#define FOR_EACH_CALLBACK_TABLE_MAPPING_1(F)
static const int kReturnValueIndex
static const int kContextSaveIndex
static const int kDataIndex
const Address kHandleZapValue
virtual void IterateInstance(ObjectVisitor *v)
#define FOR_EACH_CALLBACK_TABLE_MAPPING_2(F)