1 | // Copyright 2018 the V8 project authors. All rights reserved. |
---|---|
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | #ifndef V8_ARGUMENTS_INL_H_ |
6 | #define V8_ARGUMENTS_INL_H_ |
7 | |
8 | #include "src/arguments.h" |
9 | |
10 | #include "src/handles-inl.h" |
11 | #include "src/objects-inl.h" // TODO(jkummerow): Just smi-inl.h. |
12 | |
13 | namespace v8 { |
14 | namespace internal { |
15 | |
16 | template <class S> |
17 | Handle<S> Arguments::at(int index) { |
18 | return Handle<S>::cast(at<Object>(index)); |
19 | } |
20 | |
21 | int Arguments::smi_at(int index) { |
22 | return Smi::ToInt(Object(*address_of_arg_at(index))); |
23 | } |
24 | |
25 | double Arguments::number_at(int index) { return (*this)[index]->Number(); } |
26 | |
27 | } // namespace internal |
28 | } // namespace v8 |
29 | |
30 | #endif // V8_ARGUMENTS_INL_H_ |
31 |