• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_BUILTINS_BUILTINS_UTILS_INL_H_
6 #define V8_BUILTINS_BUILTINS_UTILS_INL_H_
7 
8 #include "src/builtins/builtins-utils.h"
9 
10 #include "src/arguments-inl.h"
11 
12 namespace v8 {
13 namespace internal {
14 
atOrUndefined(Isolate * isolate,int index)15 Handle<Object> BuiltinArguments::atOrUndefined(Isolate* isolate, int index) {
16   if (index >= length()) {
17     return isolate->factory()->undefined_value();
18   }
19   return at<Object>(index);
20 }
21 
receiver()22 Handle<Object> BuiltinArguments::receiver() { return at<Object>(0); }
23 
target()24 Handle<JSFunction> BuiltinArguments::target() {
25   return Arguments::at<JSFunction>(Arguments::length() - 1 - kTargetOffset);
26 }
27 
new_target()28 Handle<HeapObject> BuiltinArguments::new_target() {
29   return Arguments::at<HeapObject>(Arguments::length() - 1 - kNewTargetOffset);
30 }
31 
32 }  // namespace internal
33 }  // namespace v8
34 
35 #endif  // V8_BUILTINS_BUILTINS_UTILS_INL_H_
36