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-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 assembler.Goto(&if_wrapjsvalue); | 445 assembler.Goto(&if_wrapjsvalue); |
446 | 446 |
447 assembler.Bind(&if_number); | 447 assembler.Bind(&if_number); |
448 constructor_function_index_var.Bind( | 448 constructor_function_index_var.Bind( |
449 assembler.IntPtrConstant(Context::NUMBER_FUNCTION_INDEX)); | 449 assembler.IntPtrConstant(Context::NUMBER_FUNCTION_INDEX)); |
450 assembler.Goto(&if_wrapjsvalue); | 450 assembler.Goto(&if_wrapjsvalue); |
451 | 451 |
452 assembler.Bind(&if_wrapjsvalue); | 452 assembler.Bind(&if_wrapjsvalue); |
453 Node* native_context = assembler.LoadNativeContext(context); | 453 Node* native_context = assembler.LoadNativeContext(context); |
454 Node* constructor = assembler.LoadFixedArrayElement( | 454 Node* constructor = assembler.LoadFixedArrayElement( |
455 native_context, constructor_function_index_var.value(), 0, | 455 native_context, constructor_function_index_var.value()); |
456 CodeStubAssembler::INTPTR_PARAMETERS); | |
457 Node* initial_map = assembler.LoadObjectField( | 456 Node* initial_map = assembler.LoadObjectField( |
458 constructor, JSFunction::kPrototypeOrInitialMapOffset); | 457 constructor, JSFunction::kPrototypeOrInitialMapOffset); |
459 Node* js_value = assembler.Allocate(JSValue::kSize); | 458 Node* js_value = assembler.Allocate(JSValue::kSize); |
460 assembler.StoreMapNoWriteBarrier(js_value, initial_map); | 459 assembler.StoreMapNoWriteBarrier(js_value, initial_map); |
461 assembler.StoreObjectFieldRoot(js_value, JSValue::kPropertiesOffset, | 460 assembler.StoreObjectFieldRoot(js_value, JSValue::kPropertiesOffset, |
462 Heap::kEmptyFixedArrayRootIndex); | 461 Heap::kEmptyFixedArrayRootIndex); |
463 assembler.StoreObjectFieldRoot(js_value, JSObject::kElementsOffset, | 462 assembler.StoreObjectFieldRoot(js_value, JSObject::kElementsOffset, |
464 Heap::kEmptyFixedArrayRootIndex); | 463 Heap::kEmptyFixedArrayRootIndex); |
465 assembler.StoreObjectField(js_value, JSValue::kValueOffset, object); | 464 assembler.StoreObjectField(js_value, JSValue::kValueOffset, object); |
466 assembler.Return(js_value); | 465 assembler.Return(js_value); |
(...skipping 15 matching lines...) Expand all Loading... |
482 CodeStubAssembler assembler(state); | 481 CodeStubAssembler assembler(state); |
483 | 482 |
484 Node* object = assembler.Parameter(Descriptor::kObject); | 483 Node* object = assembler.Parameter(Descriptor::kObject); |
485 Node* context = assembler.Parameter(Descriptor::kContext); | 484 Node* context = assembler.Parameter(Descriptor::kContext); |
486 | 485 |
487 assembler.Return(assembler.Typeof(object, context)); | 486 assembler.Return(assembler.Typeof(object, context)); |
488 } | 487 } |
489 | 488 |
490 } // namespace internal | 489 } // namespace internal |
491 } // namespace v8 | 490 } // namespace v8 |
OLD | NEW |