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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 return GetParameter(2); | 541 return GetParameter(2); |
542 } | 542 } |
543 | 543 |
544 | 544 |
545 Handle<Code> StoreScriptContextFieldStub::GenerateCode() { | 545 Handle<Code> StoreScriptContextFieldStub::GenerateCode() { |
546 return DoGenerateCode(this); | 546 return DoGenerateCode(this); |
547 } | 547 } |
548 | 548 |
549 | 549 |
550 template <> | 550 template <> |
| 551 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() { |
| 552 HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex); |
| 553 HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex); |
| 554 HValue* current_capacity = |
| 555 GetParameter(GrowArrayElementsDescriptor::kCapacityIndex); |
| 556 ElementsKind kind = casted_stub()->elements_kind(); |
| 557 |
| 558 HValue* elements = AddLoadElements(object); |
| 559 HValue* length = |
| 560 casted_stub()->is_js_array() |
| 561 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), |
| 562 HObjectAccess::ForArrayLength(kind)) |
| 563 : current_capacity; |
| 564 |
| 565 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length, |
| 566 current_capacity, key); |
| 567 } |
| 568 |
| 569 |
| 570 Handle<Code> GrowArrayElementsStub::GenerateCode() { |
| 571 return DoGenerateCode(this); |
| 572 } |
| 573 |
| 574 |
| 575 template <> |
551 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { | 576 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { |
552 HInstruction* load = BuildUncheckedMonomorphicElementAccess( | 577 HInstruction* load = BuildUncheckedMonomorphicElementAccess( |
553 GetParameter(LoadDescriptor::kReceiverIndex), | 578 GetParameter(LoadDescriptor::kReceiverIndex), |
554 GetParameter(LoadDescriptor::kNameIndex), NULL, | 579 GetParameter(LoadDescriptor::kNameIndex), NULL, |
555 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, | 580 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, |
556 NEVER_RETURN_HOLE, STANDARD_STORE); | 581 NEVER_RETURN_HOLE, STANDARD_STORE); |
557 return load; | 582 return load; |
558 } | 583 } |
559 | 584 |
560 | 585 |
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2061 | 2086 |
2062 // Probe the stub cache. | 2087 // Probe the stub cache. |
2063 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 2088 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
2064 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 2089 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
2065 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); | 2090 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); |
2066 | 2091 |
2067 // We never continue. | 2092 // We never continue. |
2068 return graph()->GetConstant0(); | 2093 return graph()->GetConstant0(); |
2069 } | 2094 } |
2070 } } // namespace v8::internal | 2095 } } // namespace v8::internal |
OLD | NEW |