| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 } | 571 } |
| 572 | 572 |
| 573 | 573 |
| 574 Handle<Code> StoreScriptContextFieldStub::GenerateCode() { | 574 Handle<Code> StoreScriptContextFieldStub::GenerateCode() { |
| 575 return DoGenerateCode(this); | 575 return DoGenerateCode(this); |
| 576 } | 576 } |
| 577 | 577 |
| 578 | 578 |
| 579 template <> | 579 template <> |
| 580 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() { | 580 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() { |
| 581 ElementsKind kind = casted_stub()->elements_kind(); |
| 582 if (IsFastDoubleElementsKind(kind)) { |
| 583 info()->MarkAsSavesCallerDoubles(); |
| 584 } |
| 585 |
| 581 HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex); | 586 HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex); |
| 582 HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex); | 587 HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex); |
| 583 HValue* current_capacity = | |
| 584 GetParameter(GrowArrayElementsDescriptor::kCapacityIndex); | |
| 585 ElementsKind kind = casted_stub()->elements_kind(); | |
| 586 | 588 |
| 587 HValue* elements = AddLoadElements(object); | 589 HValue* elements = AddLoadElements(object); |
| 590 HValue* current_capacity = Add<HLoadNamedField>( |
| 591 elements, nullptr, HObjectAccess::ForFixedArrayLength()); |
| 592 |
| 588 HValue* length = | 593 HValue* length = |
| 589 casted_stub()->is_js_array() | 594 casted_stub()->is_js_array() |
| 590 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), | 595 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), |
| 591 HObjectAccess::ForArrayLength(kind)) | 596 HObjectAccess::ForArrayLength(kind)) |
| 592 : current_capacity; | 597 : current_capacity; |
| 593 | 598 |
| 594 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length, | 599 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length, |
| 595 current_capacity, key); | 600 current_capacity, key); |
| 596 } | 601 } |
| 597 | 602 |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2108 // need. | 2113 // need. |
| 2109 info()->MarkMustNotHaveEagerFrame(); | 2114 info()->MarkMustNotHaveEagerFrame(); |
| 2110 | 2115 |
| 2111 // Probe the stub cache. | 2116 // Probe the stub cache. |
| 2112 Add<HTailCallThroughMegamorphicCache>(receiver, name); | 2117 Add<HTailCallThroughMegamorphicCache>(receiver, name); |
| 2113 | 2118 |
| 2114 // We never continue. | 2119 // We never continue. |
| 2115 return graph()->GetConstant0(); | 2120 return graph()->GetConstant0(); |
| 2116 } | 2121 } |
| 2117 } } // namespace v8::internal | 2122 } } // namespace v8::internal |
| OLD | NEW |