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 #include "src/visitors.h" |
10 | 11 |
11 namespace v8 { | 12 namespace v8 { |
12 namespace internal { | 13 namespace internal { |
13 | 14 |
14 // Custom arguments replicate a small segment of stack that can be | 15 // Custom arguments replicate a small segment of stack that can be |
15 // accessed through an Arguments object the same way the actual stack | 16 // accessed through an Arguments object the same way the actual stack |
16 // can. | 17 // can. |
17 template <int kArrayLength> | 18 template <int kArrayLength> |
18 class CustomArgumentsBase : public Relocatable { | 19 class CustomArgumentsBase : public Relocatable { |
19 public: | 20 public: |
20 virtual inline void IterateInstance(ObjectVisitor* v) { | 21 virtual inline void IterateInstance(RootVisitor* v) { |
21 v->VisitPointers(values_, values_ + kArrayLength); | 22 v->VisitRootPointers(Root::kRelocatable, values_, values_ + kArrayLength); |
22 } | 23 } |
23 | 24 |
24 protected: | 25 protected: |
25 inline Object** begin() { return values_; } | 26 inline Object** begin() { return values_; } |
26 explicit inline CustomArgumentsBase(Isolate* isolate) | 27 explicit inline CustomArgumentsBase(Isolate* isolate) |
27 : Relocatable(isolate) {} | 28 : Relocatable(isolate) {} |
28 Object* values_[kArrayLength]; | 29 Object* values_[kArrayLength]; |
29 }; | 30 }; |
30 | 31 |
31 template <typename T> | 32 template <typename T> |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 192 |
192 private: | 193 private: |
193 internal::Object** argv_; | 194 internal::Object** argv_; |
194 int argc_; | 195 int argc_; |
195 }; | 196 }; |
196 | 197 |
197 } // namespace internal | 198 } // namespace internal |
198 } // namespace v8 | 199 } // namespace v8 |
199 | 200 |
200 #endif // V8_API_ARGUMENTS_H_ | 201 #endif // V8_API_ARGUMENTS_H_ |
OLD | NEW |