#ifndef V8_ARGUMENTS_H_
#define V8_ARGUMENTS_H_
-#include "allocation.h"
+#include "src/allocation.h"
+#include "src/isolate.h"
namespace v8 {
namespace internal {
// Object* Runtime_function(Arguments args) {
// ... use args[i] here ...
// }
+//
+// Note that length_ (whose value is in the integer range) is defined
+// as intptr_t to provide endian-neutrality on 64-bit archs.
class Arguments BASE_EMBEDDED {
public:
: length_(length), arguments_(arguments) { }
Object*& operator[] (int index) {
- ASSERT(0 <= index && index < length_);
+ DCHECK(0 <= index && index < length_);
return *(reinterpret_cast<Object**>(reinterpret_cast<intptr_t>(arguments_) -
index * kPointerSize));
}
}
// Get the total number of arguments including the receiver.
- int length() const { return length_; }
+ int length() const { return static_cast<int>(length_); }
Object** arguments() { return arguments_; }
private:
- int length_;
+ intptr_t length_;
Object** arguments_;
};
// They are used to generate the Call() functions below
// These aren't included in the list as they have duplicate signatures
// F(NamedPropertyEnumeratorCallback, ...)
-// F(NamedPropertyGetterCallback, ...)
#define FOR_EACH_CALLBACK_TABLE_MAPPING_0(F) \
F(IndexedPropertyEnumeratorCallback, v8::Array) \
#define FOR_EACH_CALLBACK_TABLE_MAPPING_1(F) \
- F(AccessorGetterCallback, v8::Value, v8::Local<v8::String>) \
+ F(NamedPropertyGetterCallback, v8::Value, v8::Local<v8::String>) \
+ F(AccessorNameGetterCallback, v8::Value, v8::Local<v8::Name>) \
F(NamedPropertyQueryCallback, \
v8::Integer, \
v8::Local<v8::String>) \
v8::Local<v8::Value>) \
#define FOR_EACH_CALLBACK_TABLE_MAPPING_2_VOID_RETURN(F) \
- F(AccessorSetterCallback, \
+ F(AccessorNameSetterCallback, \
void, \
- v8::Local<v8::String>, \
+ v8::Local<v8::Name>, \
v8::Local<v8::Value>) \
values[T::kReturnValueDefaultValueIndex] =
isolate->heap()->the_hole_value();
values[T::kReturnValueIndex] = isolate->heap()->the_hole_value();
- ASSERT(values[T::kHolderIndex]->IsHeapObject());
- ASSERT(values[T::kIsolateIndex]->IsSmi());
+ DCHECK(values[T::kHolderIndex]->IsHeapObject());
+ DCHECK(values[T::kIsolateIndex]->IsSmi());
}
/*
values[T::kReturnValueDefaultValueIndex] =
isolate->heap()->the_hole_value();
values[T::kReturnValueIndex] = isolate->heap()->the_hole_value();
- ASSERT(values[T::kCalleeIndex]->IsJSFunction());
- ASSERT(values[T::kHolderIndex]->IsHeapObject());
- ASSERT(values[T::kIsolateIndex]->IsSmi());
+ DCHECK(values[T::kCalleeIndex]->IsJSFunction());
+ DCHECK(values[T::kHolderIndex]->IsHeapObject());
+ DCHECK(values[T::kIsolateIndex]->IsSmi());
}
/*
#define DECLARE_RUNTIME_FUNCTION(Name) \
Object* Name(int args_length, Object** args_object, Isolate* isolate)
-#define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \
-static Type __RT_impl_##Name(Arguments args, Isolate* isolate); \
-Type Name(int args_length, Object** args_object, Isolate* isolate) { \
- CLOBBER_DOUBLE_REGISTERS(); \
- Arguments args(args_length, args_object); \
- return __RT_impl_##Name(args, isolate); \
-} \
+#define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \
+static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \
+Type Name(int args_length, Object** args_object, Isolate* isolate) { \
+ CLOBBER_DOUBLE_REGISTERS(); \
+ Arguments args(args_length, args_object); \
+ return __RT_impl_##Name(args, isolate); \
+} \
static Type __RT_impl_##Name(Arguments args, Isolate* isolate)