OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 | 86 |
87 void LCodeGen::FinishCode(Handle<Code> code) { | 87 void LCodeGen::FinishCode(Handle<Code> code) { |
88 ASSERT(is_done()); | 88 ASSERT(is_done()); |
89 code->set_stack_slots(GetStackSlotCount()); | 89 code->set_stack_slots(GetStackSlotCount()); |
90 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 90 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
91 if (FLAG_weak_embedded_maps_in_optimized_code) { | 91 if (FLAG_weak_embedded_maps_in_optimized_code) { |
92 RegisterDependentCodeForEmbeddedMaps(code); | 92 RegisterDependentCodeForEmbeddedMaps(code); |
93 } | 93 } |
94 PopulateDeoptimizationData(code); | 94 PopulateDeoptimizationData(code); |
| 95 for (int i = 0 ; i < prototype_maps_.length(); i++) { |
| 96 prototype_maps_.at(i)->AddDependentCode( |
| 97 DependentCode::kPrototypeCheckGroup, code); |
| 98 } |
95 } | 99 } |
96 | 100 |
97 | 101 |
98 void LChunkBuilder::Abort(const char* reason) { | 102 void LChunkBuilder::Abort(const char* reason) { |
99 info()->set_bailout_reason(reason); | 103 info()->set_bailout_reason(reason); |
100 status_ = ABORTED; | 104 status_ = ABORTED; |
101 } | 105 } |
102 | 106 |
103 | 107 |
104 void LCodeGen::Comment(const char* format, ...) { | 108 void LCodeGen::Comment(const char* format, ...) { |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 } | 777 } |
774 } | 778 } |
775 } | 779 } |
776 #ifdef VERIFY_HEAP | 780 #ifdef VERIFY_HEAP |
777 // This disables verification of weak embedded maps after full GC. | 781 // This disables verification of weak embedded maps after full GC. |
778 // AddDependentCode can cause a GC, which would observe the state where | 782 // AddDependentCode can cause a GC, which would observe the state where |
779 // this code is not yet in the depended code lists of the embedded maps. | 783 // this code is not yet in the depended code lists of the embedded maps. |
780 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; | 784 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; |
781 #endif | 785 #endif |
782 for (int i = 0; i < maps.length(); i++) { | 786 for (int i = 0; i < maps.length(); i++) { |
783 maps.at(i)->AddDependentCode(code); | 787 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
784 } | 788 } |
785 } | 789 } |
786 | 790 |
787 | 791 |
788 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 792 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
789 int length = deoptimizations_.length(); | 793 int length = deoptimizations_.length(); |
790 if (length == 0) return; | 794 if (length == 0) return; |
791 Handle<DeoptimizationInputData> data = | 795 Handle<DeoptimizationInputData> data = |
792 factory()->NewDeoptimizationInputData(length, TENURED); | 796 factory()->NewDeoptimizationInputData(length, TENURED); |
793 | 797 |
(...skipping 4121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4915 | 4919 |
4916 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 4920 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
4917 ASSERT(instr->temp()->Equals(instr->result())); | 4921 ASSERT(instr->temp()->Equals(instr->result())); |
4918 Register reg = ToRegister(instr->temp()); | 4922 Register reg = ToRegister(instr->temp()); |
4919 | 4923 |
4920 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 4924 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
4921 ZoneList<Handle<Map> >* maps = instr->maps(); | 4925 ZoneList<Handle<Map> >* maps = instr->maps(); |
4922 | 4926 |
4923 ASSERT(prototypes->length() == maps->length()); | 4927 ASSERT(prototypes->length() == maps->length()); |
4924 | 4928 |
4925 for (int i = 0; i < prototypes->length(); i++) { | 4929 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
4926 __ LoadHeapObject(reg, prototypes->at(i)); | 4930 for (int i = 0; i < maps->length(); i++) { |
4927 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); | 4931 prototype_maps_.Add(maps->at(i), info()->zone()); |
| 4932 } |
| 4933 __ LoadHeapObject(reg, prototypes->at(prototypes->length() - 1)); |
| 4934 } else { |
| 4935 for (int i = 0; i < prototypes->length(); i++) { |
| 4936 __ LoadHeapObject(reg, prototypes->at(i)); |
| 4937 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); |
| 4938 } |
4928 } | 4939 } |
4929 } | 4940 } |
4930 | 4941 |
4931 | 4942 |
4932 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 4943 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
4933 class DeferredAllocateObject: public LDeferredCode { | 4944 class DeferredAllocateObject: public LDeferredCode { |
4934 public: | 4945 public: |
4935 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 4946 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
4936 : LDeferredCode(codegen), instr_(instr) { } | 4947 : LDeferredCode(codegen), instr_(instr) { } |
4937 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 4948 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5758 FixedArray::kHeaderSize - kPointerSize)); | 5769 FixedArray::kHeaderSize - kPointerSize)); |
5759 __ bind(&done); | 5770 __ bind(&done); |
5760 } | 5771 } |
5761 | 5772 |
5762 | 5773 |
5763 #undef __ | 5774 #undef __ |
5764 | 5775 |
5765 } } // namespace v8::internal | 5776 } } // namespace v8::internal |
5766 | 5777 |
5767 #endif // V8_TARGET_ARCH_X64 | 5778 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |