OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_API_ARGUMENTS_H_ | 5 #ifndef V8_API_ARGUMENTS_H_ |
6 #define V8_API_ARGUMENTS_H_ | 6 #define V8_API_ARGUMENTS_H_ |
7 | 7 |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 : Super(isolate) { | 81 : Super(isolate) { |
82 Object** values = this->begin(); | 82 Object** values = this->begin(); |
83 values[T::kThisIndex] = self; | 83 values[T::kThisIndex] = self; |
84 values[T::kHolderIndex] = holder; | 84 values[T::kHolderIndex] = holder; |
85 values[T::kDataIndex] = data; | 85 values[T::kDataIndex] = data; |
86 values[T::kIsolateIndex] = reinterpret_cast<Object*>(isolate); | 86 values[T::kIsolateIndex] = reinterpret_cast<Object*>(isolate); |
87 values[T::kShouldThrowOnErrorIndex] = | 87 values[T::kShouldThrowOnErrorIndex] = |
88 Smi::FromInt(should_throw == Object::THROW_ON_ERROR ? 1 : 0); | 88 Smi::FromInt(should_throw == Object::THROW_ON_ERROR ? 1 : 0); |
89 | 89 |
90 // Here the hole is set as default value. | 90 // Here the hole is set as default value. |
91 // It cannot escape into js as it's remove in Call below. | 91 // It cannot escape into js as it's removed in Call below. |
92 values[T::kReturnValueDefaultValueIndex] = | 92 values[T::kReturnValueDefaultValueIndex] = |
93 isolate->heap()->the_hole_value(); | 93 isolate->heap()->the_hole_value(); |
94 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); | 94 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); |
95 DCHECK(values[T::kHolderIndex]->IsHeapObject()); | 95 DCHECK(values[T::kHolderIndex]->IsHeapObject()); |
96 DCHECK(values[T::kIsolateIndex]->IsSmi()); | 96 DCHECK(values[T::kIsolateIndex]->IsSmi()); |
97 } | 97 } |
98 | 98 |
99 /* | 99 /* |
100 * The following Call functions wrap the calling of all callbacks to handle | 100 * The following Call functions wrap the calling of all callbacks to handle |
101 * calling either the old or the new style callbacks depending on which one | 101 * calling either the old or the new style callbacks depending on which one |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 private: | 190 private: |
191 internal::Object** argv_; | 191 internal::Object** argv_; |
192 int argc_; | 192 int argc_; |
193 }; | 193 }; |
194 | 194 |
195 } // namespace internal | 195 } // namespace internal |
196 } // namespace v8 | 196 } // namespace v8 |
197 | 197 |
198 #endif // V8_API_ARGUMENTS_H_ | 198 #endif // V8_API_ARGUMENTS_H_ |
OLD | NEW |