| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/field-index.h" | 9 #include "src/field-index.h" |
| 10 #include "src/hydrogen.h" | 10 #include "src/hydrogen.h" |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 | 689 |
| 690 template <> | 690 template <> |
| 691 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() { | 691 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() { |
| 692 ElementsKind kind = casted_stub()->elements_kind(); | 692 ElementsKind kind = casted_stub()->elements_kind(); |
| 693 if (IsFastDoubleElementsKind(kind)) { | 693 if (IsFastDoubleElementsKind(kind)) { |
| 694 info()->MarkAsSavesCallerDoubles(); | 694 info()->MarkAsSavesCallerDoubles(); |
| 695 } | 695 } |
| 696 | 696 |
| 697 HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex); | 697 HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex); |
| 698 HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex); | 698 HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex); |
| 699 HValue* current_capacity = | |
| 700 GetParameter(GrowArrayElementsDescriptor::kCapacityIndex); | |
| 701 | 699 |
| 702 HValue* elements = AddLoadElements(object); | 700 HValue* elements = AddLoadElements(object); |
| 701 HValue* current_capacity = Add<HLoadNamedField>( |
| 702 elements, nullptr, HObjectAccess::ForFixedArrayLength()); |
| 703 |
| 703 HValue* length = | 704 HValue* length = |
| 704 casted_stub()->is_js_array() | 705 casted_stub()->is_js_array() |
| 705 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), | 706 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), |
| 706 HObjectAccess::ForArrayLength(kind)) | 707 HObjectAccess::ForArrayLength(kind)) |
| 707 : current_capacity; | 708 : current_capacity; |
| 708 | 709 |
| 709 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length, | 710 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length, |
| 710 current_capacity, key); | 711 current_capacity, key); |
| 711 } | 712 } |
| 712 | 713 |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2223 // need. | 2224 // need. |
| 2224 info()->MarkMustNotHaveEagerFrame(); | 2225 info()->MarkMustNotHaveEagerFrame(); |
| 2225 | 2226 |
| 2226 // Probe the stub cache. | 2227 // Probe the stub cache. |
| 2227 Add<HTailCallThroughMegamorphicCache>(receiver, name); | 2228 Add<HTailCallThroughMegamorphicCache>(receiver, name); |
| 2228 | 2229 |
| 2229 // We never continue. | 2230 // We never continue. |
| 2230 return graph()->GetConstant0(); | 2231 return graph()->GetConstant0(); |
| 2231 } | 2232 } |
| 2232 } } // namespace v8::internal | 2233 } } // namespace v8::internal |
| OLD | NEW |