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_EXECUTION_ARGUMENTS_INL_H_ 6 #define V8_EXECUTION_ARGUMENTS_INL_H_ 7 8 #include "src/execution/arguments.h" 9 10 #include "src/handles/handles-inl.h" 11 #include "src/objects/objects-inl.h" // TODO(jkummerow): Just smi-inl.h. 12 #include "src/objects/tagged-index.h" 13 14 namespace v8 { 15 namespace internal { 16 17 template <ArgumentsType T> smi_at(int index)18int Arguments<T>::smi_at(int index) const { 19 return Smi::ToInt(Object(*address_of_arg_at(index))); 20 } 21 22 template <ArgumentsType T> tagged_index_at(int index)23int Arguments<T>::tagged_index_at(int index) const { 24 Address raw = *address_of_arg_at(index); 25 return static_cast<int>(TaggedIndex(raw).value()); 26 } 27 28 template <ArgumentsType T> number_at(int index)29double Arguments<T>::number_at(int index) const { 30 return (*this)[index].Number(); 31 } 32 33 } // namespace internal 34 } // namespace v8 35 36 #endif // V8_EXECUTION_ARGUMENTS_INL_H_ 37