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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 return GetParameter(2); | 570 return GetParameter(2); |
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() { |
| 581 HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex); |
| 582 HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex); |
| 583 HValue* current_capacity = |
| 584 GetParameter(GrowArrayElementsDescriptor::kCapacityIndex); |
| 585 ElementsKind kind = casted_stub()->elements_kind(); |
| 586 |
| 587 HValue* elements = AddLoadElements(object); |
| 588 HValue* length = |
| 589 casted_stub()->is_js_array() |
| 590 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), |
| 591 HObjectAccess::ForArrayLength(kind)) |
| 592 : current_capacity; |
| 593 |
| 594 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length, |
| 595 current_capacity, key); |
| 596 } |
| 597 |
| 598 |
| 599 Handle<Code> GrowArrayElementsStub::GenerateCode() { |
| 600 return DoGenerateCode(this); |
| 601 } |
| 602 |
| 603 |
| 604 template <> |
580 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { | 605 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { |
581 LoadKeyedHoleMode hole_mode = casted_stub()->convert_hole_to_undefined() | 606 LoadKeyedHoleMode hole_mode = casted_stub()->convert_hole_to_undefined() |
582 ? CONVERT_HOLE_TO_UNDEFINED | 607 ? CONVERT_HOLE_TO_UNDEFINED |
583 : NEVER_RETURN_HOLE; | 608 : NEVER_RETURN_HOLE; |
584 | 609 |
585 HInstruction* load = BuildUncheckedMonomorphicElementAccess( | 610 HInstruction* load = BuildUncheckedMonomorphicElementAccess( |
586 GetParameter(LoadDescriptor::kReceiverIndex), | 611 GetParameter(LoadDescriptor::kReceiverIndex), |
587 GetParameter(LoadDescriptor::kNameIndex), NULL, | 612 GetParameter(LoadDescriptor::kNameIndex), NULL, |
588 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, | 613 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, |
589 hole_mode, STANDARD_STORE); | 614 hole_mode, STANDARD_STORE); |
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2080 // need. | 2105 // need. |
2081 info()->MarkMustNotHaveEagerFrame(); | 2106 info()->MarkMustNotHaveEagerFrame(); |
2082 | 2107 |
2083 // Probe the stub cache. | 2108 // Probe the stub cache. |
2084 Add<HTailCallThroughMegamorphicCache>(receiver, name); | 2109 Add<HTailCallThroughMegamorphicCache>(receiver, name); |
2085 | 2110 |
2086 // We never continue. | 2111 // We never continue. |
2087 return graph()->GetConstant0(); | 2112 return graph()->GetConstant0(); |
2088 } | 2113 } |
2089 } } // namespace v8::internal | 2114 } } // namespace v8::internal |
OLD | NEW |