| 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 | |
| 324 TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { | 313 TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) { |
| 325 Node* prototype = Parameter(1); | 314 Node* prototype = Parameter(1); |
| 326 Node* properties = Parameter(2); | 315 Node* properties = Parameter(2); |
| 327 Node* context = Parameter(3 + 2); | 316 Node* context = Parameter(3 + 2); |
| 328 | 317 |
| 329 Label call_runtime(this, Label::kDeferred), prototype_valid(this), | 318 Label call_runtime(this, Label::kDeferred), prototype_valid(this), |
| 330 no_properties(this); | 319 no_properties(this); |
| 331 { | 320 { |
| 332 Comment("Argument 1 check: prototype"); | 321 Comment("Argument 1 check: prototype"); |
| 333 GotoIf(WordEqual(prototype, NullConstant()), &prototype_valid); | 322 GotoIf(WordEqual(prototype, NullConstant()), &prototype_valid); |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 typedef TypeofDescriptor Descriptor; | 994 typedef TypeofDescriptor Descriptor; |
| 1006 | 995 |
| 1007 Node* object = Parameter(Descriptor::kObject); | 996 Node* object = Parameter(Descriptor::kObject); |
| 1008 Node* context = Parameter(Descriptor::kContext); | 997 Node* context = Parameter(Descriptor::kContext); |
| 1009 | 998 |
| 1010 Return(GetSuperConstructor(object, context)); | 999 Return(GetSuperConstructor(object, context)); |
| 1011 } | 1000 } |
| 1012 | 1001 |
| 1013 } // namespace internal | 1002 } // namespace internal |
| 1014 } // namespace v8 | 1003 } // namespace v8 |
| OLD | NEW |