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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 GenerateJumpTable() && | 82 GenerateJumpTable() && |
83 GenerateSafepointTable(); | 83 GenerateSafepointTable(); |
84 } | 84 } |
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 PopulateDeoptimizationData(code); | 91 PopulateDeoptimizationData(code); |
| 92 for (int i = 0 ; i < prototype_maps_.length(); i++) { |
| 93 prototype_maps_.at(i)->AddDependentCode( |
| 94 DependentCode::kPrototypeCheckGroup, code); |
| 95 } |
92 } | 96 } |
93 | 97 |
94 | 98 |
95 void LChunkBuilder::Abort(const char* reason) { | 99 void LChunkBuilder::Abort(const char* reason) { |
96 info()->set_bailout_reason(reason); | 100 info()->set_bailout_reason(reason); |
97 status_ = ABORTED; | 101 status_ = ABORTED; |
98 } | 102 } |
99 | 103 |
100 | 104 |
101 void LCodeGen::Comment(const char* format, ...) { | 105 void LCodeGen::Comment(const char* format, ...) { |
(...skipping 4797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4899 | 4903 |
4900 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 4904 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
4901 ASSERT(instr->temp()->Equals(instr->result())); | 4905 ASSERT(instr->temp()->Equals(instr->result())); |
4902 Register reg = ToRegister(instr->temp()); | 4906 Register reg = ToRegister(instr->temp()); |
4903 | 4907 |
4904 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 4908 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
4905 ZoneList<Handle<Map> >* maps = instr->maps(); | 4909 ZoneList<Handle<Map> >* maps = instr->maps(); |
4906 | 4910 |
4907 ASSERT(prototypes->length() == maps->length()); | 4911 ASSERT(prototypes->length() == maps->length()); |
4908 | 4912 |
4909 for (int i = 0; i < prototypes->length(); i++) { | 4913 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
4910 __ LoadHeapObject(reg, prototypes->at(i)); | 4914 for (int i = 0; i < maps->length(); i++) { |
4911 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); | 4915 prototype_maps_.Add(maps->at(i), info()->zone()); |
| 4916 } |
| 4917 __ LoadHeapObject(reg, prototypes->at(prototypes->length() - 1)); |
| 4918 } else { |
| 4919 for (int i = 0; i < prototypes->length(); i++) { |
| 4920 __ LoadHeapObject(reg, prototypes->at(i)); |
| 4921 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); |
| 4922 } |
4912 } | 4923 } |
4913 } | 4924 } |
4914 | 4925 |
4915 | 4926 |
4916 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 4927 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
4917 class DeferredAllocateObject: public LDeferredCode { | 4928 class DeferredAllocateObject: public LDeferredCode { |
4918 public: | 4929 public: |
4919 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 4930 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
4920 : LDeferredCode(codegen), instr_(instr) { } | 4931 : LDeferredCode(codegen), instr_(instr) { } |
4921 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 4932 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5742 FixedArray::kHeaderSize - kPointerSize)); | 5753 FixedArray::kHeaderSize - kPointerSize)); |
5743 __ bind(&done); | 5754 __ bind(&done); |
5744 } | 5755 } |
5745 | 5756 |
5746 | 5757 |
5747 #undef __ | 5758 #undef __ |
5748 | 5759 |
5749 } } // namespace v8::internal | 5760 } } // namespace v8::internal |
5750 | 5761 |
5751 #endif // V8_TARGET_ARCH_X64 | 5762 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |