OLD | NEW |
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 #include "src/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 | 6 |
7 #include "src/api-arguments.h" | 7 #include "src/api-arguments.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/builtins/builtins-utils.h" | 9 #include "src/builtins/builtins-utils.h" |
10 #include "src/counters.h" | 10 #include "src/counters.h" |
11 #include "src/log.h" | 11 #include "src/log.h" |
12 #include "src/objects-inl.h" | 12 #include "src/objects-inl.h" |
13 #include "src/prototype.h" | 13 #include "src/prototype.h" |
| 14 #include "src/visitors.h" |
14 | 15 |
15 namespace v8 { | 16 namespace v8 { |
16 namespace internal { | 17 namespace internal { |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
20 // Returns the holder JSObject if the function can legally be called with this | 21 // Returns the holder JSObject if the function can legally be called with this |
21 // receiver. Returns nullptr if the call is illegal. | 22 // receiver. Returns nullptr if the call is illegal. |
22 // TODO(dcarney): CallOptimization duplicates this logic, merge. | 23 // TODO(dcarney): CallOptimization duplicates this logic, merge. |
23 JSObject* GetCompatibleReceiver(Isolate* isolate, FunctionTemplateInfo* info, | 24 JSObject* GetCompatibleReceiver(Isolate* isolate, FunctionTemplateInfo* info, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 144 } |
144 } | 145 } |
145 | 146 |
146 namespace { | 147 namespace { |
147 | 148 |
148 class RelocatableArguments : public BuiltinArguments, public Relocatable { | 149 class RelocatableArguments : public BuiltinArguments, public Relocatable { |
149 public: | 150 public: |
150 RelocatableArguments(Isolate* isolate, int length, Object** arguments) | 151 RelocatableArguments(Isolate* isolate, int length, Object** arguments) |
151 : BuiltinArguments(length, arguments), Relocatable(isolate) {} | 152 : BuiltinArguments(length, arguments), Relocatable(isolate) {} |
152 | 153 |
153 virtual inline void IterateInstance(ObjectVisitor* v) { | 154 virtual inline void IterateInstance(RootVisitor* v) { |
154 if (length() == 0) return; | 155 if (length() == 0) return; |
155 v->VisitPointers(lowest_address(), highest_address() + 1); | 156 v->VisitRootPointers(Root::kRelocatable, lowest_address(), |
| 157 highest_address() + 1); |
156 } | 158 } |
157 | 159 |
158 private: | 160 private: |
159 DISALLOW_COPY_AND_ASSIGN(RelocatableArguments); | 161 DISALLOW_COPY_AND_ASSIGN(RelocatableArguments); |
160 }; | 162 }; |
161 | 163 |
162 } // namespace | 164 } // namespace |
163 | 165 |
164 MaybeHandle<Object> Builtins::InvokeApiFunction(Isolate* isolate, | 166 MaybeHandle<Object> Builtins::InvokeApiFunction(Isolate* isolate, |
165 bool is_construct, | 167 bool is_construct, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 289 } |
288 | 290 |
289 // Handle calls to non-function objects created through the API. This delegate | 291 // Handle calls to non-function objects created through the API. This delegate |
290 // function is used when the call is a construct call. | 292 // function is used when the call is a construct call. |
291 BUILTIN(HandleApiCallAsConstructor) { | 293 BUILTIN(HandleApiCallAsConstructor) { |
292 return HandleApiCallAsFunctionOrConstructor(isolate, true, args); | 294 return HandleApiCallAsFunctionOrConstructor(isolate, true, args); |
293 } | 295 } |
294 | 296 |
295 } // namespace internal | 297 } // namespace internal |
296 } // namespace v8 | 298 } // namespace v8 |
OLD | NEW |