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-object.h" | 5 #include "src/builtins/builtins-object.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 #include "src/builtins/builtins.h" | 7 #include "src/builtins/builtins.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stub-assembler.h" | 9 #include "src/code-stub-assembler.h" |
10 #include "src/counters.h" | 10 #include "src/counters.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // Return object if the proxy {receiver} is not callable. | 303 // Return object if the proxy {receiver} is not callable. |
304 Branch(IsCallableMap(map), &return_function, &return_object); | 304 Branch(IsCallableMap(map), &return_function, &return_object); |
305 } | 305 } |
306 | 306 |
307 // Default | 307 // Default |
308 Bind(&return_object); | 308 Bind(&return_object); |
309 Return(HeapConstant(isolate()->factory()->object_to_string())); | 309 Return(HeapConstant(isolate()->factory()->object_to_string())); |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
| 313 // ES6 19.3.7 Object.prototype.valueOf |
| 314 TF_BUILTIN(ObjectPrototypeValueOf, CodeStubAssembler) { |
| 315 Node* receiver = Parameter(0); |
| 316 Node* context = Parameter(3); |
| 317 |
| 318 Callable to_object = CodeFactory::ToObject(isolate()); |
| 319 receiver = CallStub(to_object, context, receiver); |
| 320 |
| 321 Return(receiver); |
| 322 } |
| 323 |
313 TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { | 324 TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { |
314 Node* prototype = Parameter(1); | 325 Node* prototype = Parameter(1); |
315 Node* properties = Parameter(2); | 326 Node* properties = Parameter(2); |
316 Node* context = Parameter(3 + 2); | 327 Node* context = Parameter(3 + 2); |
317 | 328 |
318 Label call_runtime(this, Label::kDeferred), prototype_valid(this), | 329 Label call_runtime(this, Label::kDeferred), prototype_valid(this), |
319 no_properties(this); | 330 no_properties(this); |
320 { | 331 { |
321 Comment("Argument 1 check: prototype"); | 332 Comment("Argument 1 check: prototype"); |
322 GotoIf(WordEqual(prototype, NullConstant()), &prototype_valid); | 333 GotoIf(WordEqual(prototype, NullConstant()), &prototype_valid); |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 typedef TypeofDescriptor Descriptor; | 1005 typedef TypeofDescriptor Descriptor; |
995 | 1006 |
996 Node* object = Parameter(Descriptor::kObject); | 1007 Node* object = Parameter(Descriptor::kObject); |
997 Node* context = Parameter(Descriptor::kContext); | 1008 Node* context = Parameter(Descriptor::kContext); |
998 | 1009 |
999 Return(GetSuperConstructor(object, context)); | 1010 Return(GetSuperConstructor(object, context)); |
1000 } | 1011 } |
1001 | 1012 |
1002 } // namespace internal | 1013 } // namespace internal |
1003 } // namespace v8 | 1014 } // namespace v8 |
OLD | NEW |