OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ARGUMENTS_H_ | 5 #ifndef V8_ARGUMENTS_H_ |
6 #define V8_ARGUMENTS_H_ | 6 #define V8_ARGUMENTS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 | 10 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 public: | 145 public: |
146 typedef PropertyCallbackInfo<Value> T; | 146 typedef PropertyCallbackInfo<Value> T; |
147 typedef CustomArguments<T> Super; | 147 typedef CustomArguments<T> Super; |
148 static const int kArgsLength = T::kArgsLength; | 148 static const int kArgsLength = T::kArgsLength; |
149 static const int kThisIndex = T::kThisIndex; | 149 static const int kThisIndex = T::kThisIndex; |
150 static const int kHolderIndex = T::kHolderIndex; | 150 static const int kHolderIndex = T::kHolderIndex; |
151 static const int kDataIndex = T::kDataIndex; | 151 static const int kDataIndex = T::kDataIndex; |
152 static const int kReturnValueDefaultValueIndex = | 152 static const int kReturnValueDefaultValueIndex = |
153 T::kReturnValueDefaultValueIndex; | 153 T::kReturnValueDefaultValueIndex; |
154 static const int kIsolateIndex = T::kIsolateIndex; | 154 static const int kIsolateIndex = T::kIsolateIndex; |
155 static const int kShouldThrowOnErrorIndex = T::kShouldThrowOnErrorIndex; | |
156 | 155 |
157 PropertyCallbackArguments(Isolate* isolate, Object* data, Object* self, | 156 PropertyCallbackArguments(Isolate* isolate, |
158 JSObject* holder, Object::ShouldThrow should_throw) | 157 Object* data, |
| 158 Object* self, |
| 159 JSObject* holder) |
159 : Super(isolate) { | 160 : Super(isolate) { |
160 Object** values = this->begin(); | 161 Object** values = this->begin(); |
161 values[T::kThisIndex] = self; | 162 values[T::kThisIndex] = self; |
162 values[T::kHolderIndex] = holder; | 163 values[T::kHolderIndex] = holder; |
163 values[T::kDataIndex] = data; | 164 values[T::kDataIndex] = data; |
164 values[T::kIsolateIndex] = reinterpret_cast<Object*>(isolate); | 165 values[T::kIsolateIndex] = reinterpret_cast<Object*>(isolate); |
165 values[T::kShouldThrowOnErrorIndex] = | |
166 Smi::FromInt(should_throw == Object::THROW_ON_ERROR ? 1 : 0); | |
167 | |
168 // Here the hole is set as default value. | 166 // Here the hole is set as default value. |
169 // It cannot escape into js as it's remove in Call below. | 167 // It cannot escape into js as it's remove in Call below. |
170 values[T::kReturnValueDefaultValueIndex] = | 168 values[T::kReturnValueDefaultValueIndex] = |
171 isolate->heap()->the_hole_value(); | 169 isolate->heap()->the_hole_value(); |
172 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); | 170 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); |
173 DCHECK(values[T::kHolderIndex]->IsHeapObject()); | 171 DCHECK(values[T::kHolderIndex]->IsHeapObject()); |
174 DCHECK(values[T::kIsolateIndex]->IsSmi()); | 172 DCHECK(values[T::kIsolateIndex]->IsSmi()); |
175 } | 173 } |
176 | 174 |
177 /* | 175 /* |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) | 285 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) |
288 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ | 286 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ |
289 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) | 287 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) |
290 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ | 288 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ |
291 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) | 289 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) |
292 | 290 |
293 } // namespace internal | 291 } // namespace internal |
294 } // namespace v8 | 292 } // namespace v8 |
295 | 293 |
296 #endif // V8_ARGUMENTS_H_ | 294 #endif // V8_ARGUMENTS_H_ |
OLD | NEW |