/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/src/execution/arguments-inl.h
63 строки
2 KB
Michaël Zasso
deps: update V8 to 13.6.233.8
02 май 2025, 16:06
Не верифицирован
02 май 2025, 16:06
918fe04
Код
Авторство
О чём код?
// Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_EXECUTION_ARGUMENTS_INL_H_ #define V8_EXECUTION_ARGUMENTS_INL_H_ #include "src/execution/arguments.h" // Include the non-inl header before the rest of the headers. #include "src/handles/handles-inl.h" #include "src/objects/objects-inl.h" // TODO(jkummerow): Just smi-inl.h. #include "src/objects/tagged-index.h" namespace v8 { namespace internal { template <ArgumentsType T> Arguments<T>::ChangeValueScope::ChangeValueScope(Isolate* isolate, Arguments* args, int index, Tagged<Object> value) : location_(args->address_of_arg_at(index)) { old_value_ = direct_handle(Tagged<Object>(*location_), isolate); *location_ = value.ptr(); } template <ArgumentsType T> int Arguments<T>::smi_value_at(int index) const { Tagged<Object> obj = (*this)[index]; int value = Smi::ToInt(obj); DCHECK_IMPLIES(IsTaggedIndex(obj), value == tagged_index_value_at(index)); return value; } template <ArgumentsType T> uint32_t Arguments<T>::positive_smi_value_at(int index) const { int value = smi_value_at(index); DCHECK_LE(0, value); return value; } template <ArgumentsType T> int Arguments<T>::tagged_index_value_at(int index) const { return static_cast<int>(Cast<TaggedIndex>((*this)[index]).value()); } template <ArgumentsType T> double Arguments<T>::number_value_at(int index) const { return Object::NumberValue((*this)[index]); } template <ArgumentsType T> Handle<Object> Arguments<T>::atOrUndefined(Isolate* isolate, int index) const { if (index >= length_) { return Cast<Object>(isolate->factory()->undefined_value()); } return at<Object>(index); } } // namespace internal } // namespace v8 #endif // V8_EXECUTION_ARGUMENTS_INL_H_