Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: src/builtins/builtins-utils.h

Issue 2422573002: [builtins] Remove template argument from args.target(). (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins/builtins-iterator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_BUILTINS_BUILTINS_UTILS_H_ 5 #ifndef V8_BUILTINS_BUILTINS_UTILS_H_
6 #define V8_BUILTINS_BUILTINS_UTILS_H_ 6 #define V8_BUILTINS_BUILTINS_UTILS_H_
7 7
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/base/logging.h" 9 #include "src/base/logging.h"
10 #include "src/builtins/builtins.h" 10 #include "src/builtins/builtins.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 Handle<Object> receiver() { return Arguments::at<Object>(0); } 43 Handle<Object> receiver() { return Arguments::at<Object>(0); }
44 44
45 static const int kNewTargetOffset = 0; 45 static const int kNewTargetOffset = 0;
46 static const int kTargetOffset = 1; 46 static const int kTargetOffset = 1;
47 static const int kArgcOffset = 2; 47 static const int kArgcOffset = 2;
48 static const int kNumExtraArgs = 3; 48 static const int kNumExtraArgs = 3;
49 static const int kNumExtraArgsWithReceiver = 4; 49 static const int kNumExtraArgsWithReceiver = 4;
50 50
51 template <class S> 51 Handle<JSFunction> target() {
52 Handle<S> target() { 52 return Arguments::at<JSFunction>(Arguments::length() - 1 - kTargetOffset);
53 return Arguments::at<S>(Arguments::length() - 1 - kTargetOffset);
54 } 53 }
55 Handle<HeapObject> new_target() { 54 Handle<HeapObject> new_target() {
56 return Arguments::at<HeapObject>(Arguments::length() - 1 - 55 return Arguments::at<HeapObject>(Arguments::length() - 1 -
57 kNewTargetOffset); 56 kNewTargetOffset);
58 } 57 }
59 58
60 // Gets the total number of arguments including the receiver (but 59 // Gets the total number of arguments including the receiver (but
61 // excluding extra arguments). 60 // excluding extra arguments).
62 int length() const { return Arguments::length() - kNumExtraArgs; } 61 int length() const { return Arguments::length() - kNumExtraArgs; }
63 }; 62 };
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 isolate->factory()->NewStringFromAsciiChecked(method))); \ 126 isolate->factory()->NewStringFromAsciiChecked(method))); \
128 } \ 127 } \
129 Handle<String> name; \ 128 Handle<String> name; \
130 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \ 129 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \
131 isolate, name, Object::ToString(isolate, args.receiver())) 130 isolate, name, Object::ToString(isolate, args.receiver()))
132 131
133 } // namespace internal 132 } // namespace internal
134 } // namespace v8 133 } // namespace v8
135 134
136 #endif // V8_BUILTINS_BUILTINS_UTILS_H_ 135 #endif // V8_BUILTINS_BUILTINS_UTILS_H_
OLDNEW
« no previous file with comments | « src/builtins/builtins-iterator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698