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; |
155 | 156 |
156 PropertyCallbackArguments(Isolate* isolate, | 157 PropertyCallbackArguments(Isolate* isolate, Object* data, Object* self, |
157 Object* data, | 158 JSObject* holder, Object::ShouldThrow should_throw) |
158 Object* self, | |
159 JSObject* holder) | |
160 : Super(isolate) { | 159 : Super(isolate) { |
161 Object** values = this->begin(); | 160 Object** values = this->begin(); |
162 values[T::kThisIndex] = self; | 161 values[T::kThisIndex] = self; |
163 values[T::kHolderIndex] = holder; | 162 values[T::kHolderIndex] = holder; |
164 values[T::kDataIndex] = data; | 163 values[T::kDataIndex] = data; |
165 values[T::kIsolateIndex] = reinterpret_cast<Object*>(isolate); | 164 values[T::kIsolateIndex] = reinterpret_cast<Object*>(isolate); |
| 165 values[T::kShouldThrowOnErrorIndex] = |
| 166 Smi::FromInt(should_throw == Object::THROW_ON_ERROR ? 1 : 0); |
| 167 |
166 // Here the hole is set as default value. | 168 // Here the hole is set as default value. |
167 // It cannot escape into js as it's remove in Call below. | 169 // It cannot escape into js as it's remove in Call below. |
168 values[T::kReturnValueDefaultValueIndex] = | 170 values[T::kReturnValueDefaultValueIndex] = |
169 isolate->heap()->the_hole_value(); | 171 isolate->heap()->the_hole_value(); |
170 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); | 172 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); |
171 DCHECK(values[T::kHolderIndex]->IsHeapObject()); | 173 DCHECK(values[T::kHolderIndex]->IsHeapObject()); |
172 DCHECK(values[T::kIsolateIndex]->IsSmi()); | 174 DCHECK(values[T::kIsolateIndex]->IsSmi()); |
173 } | 175 } |
174 | 176 |
175 /* | 177 /* |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) | 287 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) |
286 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ | 288 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ |
287 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) | 289 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) |
288 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ | 290 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ |
289 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) | 291 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) |
290 | 292 |
291 } // namespace internal | 293 } // namespace internal |
292 } // namespace v8 | 294 } // namespace v8 |
293 | 295 |
294 #endif // V8_ARGUMENTS_H_ | 296 #endif // V8_ARGUMENTS_H_ |
OLD | NEW |