Revision f230a1cf deps/v8/src/arguments.h
deps/v8/src/arguments.h | ||
---|---|---|
137 | 137 |
v->VisitPointers(values_, values_ + kArrayLength); |
138 | 138 |
} |
139 | 139 |
protected: |
140 |
inline Object** end() { return values_ + kArrayLength - 1; }
|
|
140 |
inline Object** begin() { return values_; }
|
|
141 | 141 |
explicit inline CustomArgumentsBase(Isolate* isolate) |
142 | 142 |
: Relocatable(isolate) {} |
143 | 143 |
Object* values_[kArrayLength]; |
... | ... | |
151 | 151 |
|
152 | 152 |
typedef CustomArgumentsBase<T::kArgsLength> Super; |
153 | 153 |
~CustomArguments() { |
154 |
this->end()[kReturnValueOffset] =
|
|
154 |
this->begin()[kReturnValueOffset] =
|
|
155 | 155 |
reinterpret_cast<Object*>(kHandleZapValue); |
156 | 156 |
} |
157 | 157 |
|
... | ... | |
162 | 162 |
v8::Handle<V> GetReturnValue(Isolate* isolate); |
163 | 163 |
|
164 | 164 |
inline Isolate* isolate() { |
165 |
return reinterpret_cast<Isolate*>(this->end()[T::kIsolateIndex]);
|
|
165 |
return reinterpret_cast<Isolate*>(this->begin()[T::kIsolateIndex]);
|
|
166 | 166 |
} |
167 | 167 |
}; |
168 | 168 |
|
... | ... | |
185 | 185 |
Object* self, |
186 | 186 |
JSObject* holder) |
187 | 187 |
: Super(isolate) { |
188 |
Object** values = this->end();
|
|
188 |
Object** values = this->begin();
|
|
189 | 189 |
values[T::kThisIndex] = self; |
190 | 190 |
values[T::kHolderIndex] = holder; |
191 | 191 |
values[T::kDataIndex] = data; |
... | ... | |
237 | 237 |
typedef FunctionCallbackInfo<Value> T; |
238 | 238 |
typedef CustomArguments<T> Super; |
239 | 239 |
static const int kArgsLength = T::kArgsLength; |
240 |
static const int kHolderIndex = T::kHolderIndex; |
|
241 |
static const int kDataIndex = T::kDataIndex; |
|
242 |
static const int kReturnValueDefaultValueIndex = |
|
243 |
T::kReturnValueDefaultValueIndex; |
|
244 |
static const int kIsolateIndex = T::kIsolateIndex; |
|
245 |
static const int kCalleeIndex = T::kCalleeIndex; |
|
246 |
static const int kContextSaveIndex = T::kContextSaveIndex; |
|
240 | 247 |
|
241 | 248 |
FunctionCallbackArguments(internal::Isolate* isolate, |
242 | 249 |
internal::Object* data, |
... | ... | |
249 | 256 |
argv_(argv), |
250 | 257 |
argc_(argc), |
251 | 258 |
is_construct_call_(is_construct_call) { |
252 |
Object** values = end();
|
|
259 |
Object** values = begin();
|
|
253 | 260 |
values[T::kDataIndex] = data; |
254 | 261 |
values[T::kCalleeIndex] = callee; |
255 | 262 |
values[T::kHolderIndex] = holder; |
263 |
values[T::kContextSaveIndex] = isolate->heap()->the_hole_value(); |
|
256 | 264 |
values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate); |
257 | 265 |
// Here the hole is set as default value. |
258 | 266 |
// It cannot escape into js as it's remove in Call below. |
Also available in: Unified diff