OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 } | 521 } |
522 | 522 |
523 | 523 |
524 Handle<Code> KeyedStoreFastElementStub::GenerateCode() { | 524 Handle<Code> KeyedStoreFastElementStub::GenerateCode() { |
525 return DoGenerateCode(this); | 525 return DoGenerateCode(this); |
526 } | 526 } |
527 | 527 |
528 | 528 |
529 template <> | 529 template <> |
530 HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() { | 530 HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() { |
| 531 TransitionElementsKindStub* stub = casted_stub(); |
| 532 ElementsKind from_kind = stub->from_kind(); |
| 533 ElementsKind to_kind = stub->to_kind(); |
| 534 |
531 HValue* js_array = GetParameter(0); | 535 HValue* js_array = GetParameter(0); |
532 HValue* map = GetParameter(1); | 536 HValue* map = GetParameter(1); |
533 | 537 |
534 info()->MarkAsSavesCallerDoubles(); | 538 info()->MarkAsSavesCallerDoubles(); |
535 | 539 |
536 Add<HTrapAllocationMemento>(js_array); | 540 if (AllocationSite::GetMode(from_kind, to_kind) == TRACK_ALLOCATION_SITE) { |
| 541 Add<HTrapAllocationMemento>(js_array); |
| 542 } |
537 | 543 |
538 HInstruction* array_length = | 544 HInstruction* array_length = |
539 AddLoad(js_array, HObjectAccess::ForArrayLength()); | 545 AddLoad(js_array, HObjectAccess::ForArrayLength()); |
540 array_length->set_type(HType::Smi()); | 546 array_length->set_type(HType::Smi()); |
541 | 547 |
542 IfBuilder if_builder(this); | 548 IfBuilder if_builder(this); |
543 | 549 |
544 if_builder.IfNot<HCompareNumericAndBranch>(array_length, | 550 if_builder.IfNot<HCompareNumericAndBranch>(array_length, |
545 graph()->GetConstant0(), | 551 graph()->GetConstant0(), |
546 Token::EQ); | 552 Token::EQ); |
547 if_builder.Then(); | 553 if_builder.Then(); |
548 | 554 |
549 HInstruction* elements = AddLoadElements(js_array); | 555 HInstruction* elements = AddLoadElements(js_array); |
550 | 556 |
551 HInstruction* elements_length = AddLoadFixedArrayLength(elements); | 557 HInstruction* elements_length = AddLoadFixedArrayLength(elements); |
552 | 558 |
553 BuildGrowElementsCapacity(js_array, elements, | 559 BuildGrowElementsCapacity(js_array, elements, from_kind, to_kind, |
554 casted_stub()->from_kind(), | |
555 casted_stub()->to_kind(), | |
556 array_length, elements_length); | 560 array_length, elements_length); |
557 | 561 |
558 if_builder.End(); | 562 if_builder.End(); |
559 | 563 |
560 AddStore(js_array, HObjectAccess::ForMap(), map); | 564 AddStore(js_array, HObjectAccess::ForMap(), map); |
561 | 565 |
562 return js_array; | 566 return js_array; |
563 } | 567 } |
564 | 568 |
565 | 569 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 return value; | 903 return value; |
900 } | 904 } |
901 | 905 |
902 | 906 |
903 Handle<Code> StoreGlobalStub::GenerateCode() { | 907 Handle<Code> StoreGlobalStub::GenerateCode() { |
904 return DoGenerateCode(this); | 908 return DoGenerateCode(this); |
905 } | 909 } |
906 | 910 |
907 | 911 |
908 } } // namespace v8::internal | 912 } } // namespace v8::internal |
OLD | NEW |