| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 5780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5791 typedef compiler::Node Node; | 5791 typedef compiler::Node Node; |
| 5792 CodeStubAssembler::Label runtime(assembler, | 5792 CodeStubAssembler::Label runtime(assembler, |
| 5793 CodeStubAssembler::Label::kDeferred); | 5793 CodeStubAssembler::Label::kDeferred); |
| 5794 | 5794 |
| 5795 Node* object = assembler->Parameter(Descriptor::kObject); | 5795 Node* object = assembler->Parameter(Descriptor::kObject); |
| 5796 Node* key = assembler->Parameter(Descriptor::kKey); | 5796 Node* key = assembler->Parameter(Descriptor::kKey); |
| 5797 Node* context = assembler->Parameter(Descriptor::kContext); | 5797 Node* context = assembler->Parameter(Descriptor::kContext); |
| 5798 ElementsKind kind = elements_kind(); | 5798 ElementsKind kind = elements_kind(); |
| 5799 | 5799 |
| 5800 Node* elements = assembler->LoadElements(object); | 5800 Node* elements = assembler->LoadElements(object); |
| 5801 Node* new_elements = assembler->CheckAndGrowElementsCapacity( | 5801 Node* new_elements = |
| 5802 context, elements, kind, key, &runtime); | 5802 assembler->TryGrowElementsCapacity(object, elements, kind, key, &runtime); |
| 5803 assembler->StoreObjectField(object, JSObject::kElementsOffset, new_elements); | |
| 5804 assembler->Return(new_elements); | 5803 assembler->Return(new_elements); |
| 5805 | 5804 |
| 5806 assembler->Bind(&runtime); | 5805 assembler->Bind(&runtime); |
| 5807 // TODO(danno): Make this a tail call when the stub is only used from TurboFan | 5806 // TODO(danno): Make this a tail call when the stub is only used from TurboFan |
| 5808 // code. This musn't be a tail call for now, since the caller site in lithium | 5807 // code. This musn't be a tail call for now, since the caller site in lithium |
| 5809 // creates a safepoint. This safepoint musn't have a different number of | 5808 // creates a safepoint. This safepoint musn't have a different number of |
| 5810 // arguments on the stack in the case that a GC happens from the slow-case | 5809 // arguments on the stack in the case that a GC happens from the slow-case |
| 5811 // allocation path (zero, since all the stubs inputs are in registers) and | 5810 // allocation path (zero, since all the stubs inputs are in registers) and |
| 5812 // when the call happens (it would be two in the tail call case due to the | 5811 // when the call happens (it would be two in the tail call case due to the |
| 5813 // tail call pushing the arguments on the stack for the runtime call). By not | 5812 // tail call pushing the arguments on the stack for the runtime call). By not |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5850 | 5849 |
| 5851 if (type == MachineType::Pointer()) { | 5850 if (type == MachineType::Pointer()) { |
| 5852 return Representation::External(); | 5851 return Representation::External(); |
| 5853 } | 5852 } |
| 5854 | 5853 |
| 5855 return Representation::Tagged(); | 5854 return Representation::Tagged(); |
| 5856 } | 5855 } |
| 5857 | 5856 |
| 5858 } // namespace internal | 5857 } // namespace internal |
| 5859 } // namespace v8 | 5858 } // namespace v8 |
| OLD | NEW |