v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 2733 | skipping to change at line 2733 | |||
}; | }; | |||
template<typename T> | template<typename T> | |||
class ReturnValue { | class ReturnValue { | |||
public: | public: | |||
V8_INLINE(explicit ReturnValue(internal::Object** slot)); | V8_INLINE(explicit ReturnValue(internal::Object** slot)); | |||
// Handle setters | // Handle setters | |||
V8_INLINE(void Set(const Persistent<T>& handle)); | V8_INLINE(void Set(const Persistent<T>& handle)); | |||
V8_INLINE(void Set(const Handle<T> handle)); | V8_INLINE(void Set(const Handle<T> handle)); | |||
// Fast primitive setters | // Fast primitive setters | |||
V8_INLINE(void Set(Isolate* isolate, bool value)); | V8_INLINE(void Set(bool value)); | |||
V8_INLINE(void Set(Isolate* isolate, double i)); | V8_INLINE(void Set(double i)); | |||
V8_INLINE(void Set(Isolate* isolate, int32_t i)); | V8_INLINE(void Set(int32_t i)); | |||
V8_INLINE(void Set(Isolate* isolate, uint32_t i)); | V8_INLINE(void Set(uint32_t i)); | |||
// Fast JS primitive setters | // Fast JS primitive setters | |||
V8_INLINE(void SetNull(Isolate* isolate)); | V8_INLINE(void SetNull()); | |||
V8_INLINE(void SetUndefined(Isolate* isolate)); | V8_INLINE(void SetUndefined()); | |||
// Convenience getter for Isolate | ||||
V8_INLINE(Isolate* GetIsolate()); | ||||
private: | private: | |||
V8_INLINE(void SetTrue(Isolate* isolate)); | ||||
V8_INLINE(void SetFalse(Isolate* isolate)); | ||||
internal::Object** value_; | internal::Object** value_; | |||
}; | }; | |||
/** | /** | |||
* The argument information given to function call callbacks. This | * The argument information given to function call callbacks. This | |||
* class provides access to information about the context of the call, | * class provides access to information about the context of the call, | |||
* including the receiver, the number and values of arguments, and | * including the receiver, the number and values of arguments, and | |||
* the holder of the function. | * the holder of the function. | |||
*/ | */ | |||
template<typename T> | template<typename T> | |||
skipping to change at line 2817 | skipping to change at line 2817 | |||
// This shouldn't be public, but the arm compiler needs it. | // This shouldn't be public, but the arm compiler needs it. | |||
static const int kArgsLength = 5; | static const int kArgsLength = 5; | |||
protected: | protected: | |||
friend class MacroAssembler; | friend class MacroAssembler; | |||
friend class internal::PropertyCallbackArguments; | friend class internal::PropertyCallbackArguments; | |||
friend class internal::CustomArguments<PropertyCallbackInfo>; | friend class internal::CustomArguments<PropertyCallbackInfo>; | |||
static const int kThisIndex = 0; | static const int kThisIndex = 0; | |||
static const int kHolderIndex = -1; | static const int kHolderIndex = -1; | |||
static const int kDataIndex = -2; | static const int kDataIndex = -2; | |||
static const int kIsolateIndex = -3; | static const int kReturnValueIndex = -3; | |||
static const int kReturnValueIndex = -4; | static const int kIsolateIndex = -4; | |||
V8_INLINE(PropertyCallbackInfo(internal::Object** args)) | V8_INLINE(PropertyCallbackInfo(internal::Object** args)) | |||
: args_(args) { } | : args_(args) { } | |||
internal::Object** args_; | internal::Object** args_; | |||
}; | }; | |||
class V8EXPORT AccessorInfo : public PropertyCallbackInfo<Value> { | class V8EXPORT AccessorInfo : public PropertyCallbackInfo<Value> { | |||
private: | private: | |||
friend class internal::PropertyCallbackArguments; | friend class internal::PropertyCallbackArguments; | |||
V8_INLINE(AccessorInfo(internal::Object** args)) | V8_INLINE(AccessorInfo(internal::Object** args)) | |||
skipping to change at line 5563 | skipping to change at line 5563 | |||
void ReturnValue<T>::Set(const Persistent<T>& handle) { | void ReturnValue<T>::Set(const Persistent<T>& handle) { | |||
*value_ = *reinterpret_cast<internal::Object**>(*handle); | *value_ = *reinterpret_cast<internal::Object**>(*handle); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::Set(const Handle<T> handle) { | void ReturnValue<T>::Set(const Handle<T> handle) { | |||
*value_ = *reinterpret_cast<internal::Object**>(*handle); | *value_ = *reinterpret_cast<internal::Object**>(*handle); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::Set(Isolate* isolate, double i) { | void ReturnValue<T>::Set(double i) { | |||
Set(Number::New(isolate, i)); | Set(Number::New(GetIsolate(), i)); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::Set(Isolate* isolate, int32_t i) { | void ReturnValue<T>::Set(int32_t i) { | |||
typedef internal::Internals I; | typedef internal::Internals I; | |||
if (V8_LIKELY(I::IsValidSmi(i))) { | if (V8_LIKELY(I::IsValidSmi(i))) { | |||
*value_ = I::IntToSmi(i); | *value_ = I::IntToSmi(i); | |||
return; | return; | |||
} | } | |||
Set(Integer::New(i, isolate)); | Set(Integer::New(i, GetIsolate())); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::Set(Isolate* isolate, uint32_t i) { | void ReturnValue<T>::Set(uint32_t i) { | |||
typedef internal::Internals I; | typedef internal::Internals I; | |||
if (V8_LIKELY(I::IsValidSmi(i))) { | if (V8_LIKELY(I::IsValidSmi(i))) { | |||
*value_ = I::IntToSmi(i); | *value_ = I::IntToSmi(i); | |||
return; | return; | |||
} | } | |||
Set(Integer::NewFromUnsigned(i, isolate)); | Set(Integer::NewFromUnsigned(i, GetIsolate())); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::Set(Isolate* isolate, bool value) { | void ReturnValue<T>::Set(bool value) { | |||
typedef internal::Internals I; | ||||
int root_index; | ||||
if (value) { | if (value) { | |||
SetTrue(isolate); | root_index = I::kTrueValueRootIndex; | |||
} else { | } else { | |||
SetFalse(isolate); | root_index = I::kFalseValueRootIndex; | |||
} | } | |||
*value_ = *I::GetRoot(GetIsolate(), root_index); | ||||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::SetTrue(Isolate* isolate) { | void ReturnValue<T>::SetNull() { | |||
typedef internal::Internals I; | ||||
*value_ = *I::GetRoot(isolate, I::kTrueValueRootIndex); | ||||
} | ||||
template<typename T> | ||||
void ReturnValue<T>::SetFalse(Isolate* isolate) { | ||||
typedef internal::Internals I; | typedef internal::Internals I; | |||
*value_ = *I::GetRoot(isolate, I::kFalseValueRootIndex); | *value_ = *I::GetRoot(GetIsolate(), I::kNullValueRootIndex); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::SetNull(Isolate* isolate) { | void ReturnValue<T>::SetUndefined() { | |||
typedef internal::Internals I; | typedef internal::Internals I; | |||
*value_ = *I::GetRoot(isolate, I::kNullValueRootIndex); | *value_ = *I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex); | |||
} | } | |||
template<typename T> | template<typename T> | |||
void ReturnValue<T>::SetUndefined(Isolate* isolate) { | Isolate* ReturnValue<T>::GetIsolate() { | |||
typedef internal::Internals I; | // Isolate is always the pointer below value_ on the stack. | |||
*value_ = *I::GetRoot(isolate, I::kUndefinedValueRootIndex); | return *reinterpret_cast<Isolate**>(&value_[-1]); | |||
} | } | |||
template<typename T> | template<typename T> | |||
FunctionCallbackInfo<T>::FunctionCallbackInfo(internal::Object** implicit_a rgs, | FunctionCallbackInfo<T>::FunctionCallbackInfo(internal::Object** implicit_a rgs, | |||
internal::Object** values, | internal::Object** values, | |||
int length, | int length, | |||
bool is_construct_call) | bool is_construct_call) | |||
: implicit_args_(implicit_args), | : implicit_args_(implicit_args), | |||
values_(values), | values_(values), | |||
length_(length), | length_(length), | |||
End of changes. 18 change blocks. | ||||
32 lines changed or deleted | 29 lines changed or added | |||