| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 GenerateDeoptJumpTable() && | 78 GenerateDeoptJumpTable() && |
| 79 GenerateSafepointTable(); | 79 GenerateSafepointTable(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 | 82 |
| 83 void LCodeGen::FinishCode(Handle<Code> code) { | 83 void LCodeGen::FinishCode(Handle<Code> code) { |
| 84 ASSERT(is_done()); | 84 ASSERT(is_done()); |
| 85 code->set_stack_slots(GetStackSlotCount()); | 85 code->set_stack_slots(GetStackSlotCount()); |
| 86 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 86 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
| 87 PopulateDeoptimizationData(code); | 87 PopulateDeoptimizationData(code); |
| 88 for (int i = 0 ; i < prototype_maps_.length(); i++) { |
| 89 prototype_maps_.at(i)->AddDependentCode( |
| 90 DependentCode::kPrototypeCheckGroup, code); |
| 91 } |
| 88 } | 92 } |
| 89 | 93 |
| 90 | 94 |
| 91 void LChunkBuilder::Abort(const char* reason) { | 95 void LChunkBuilder::Abort(const char* reason) { |
| 92 info()->set_bailout_reason(reason); | 96 info()->set_bailout_reason(reason); |
| 93 status_ = ABORTED; | 97 status_ = ABORTED; |
| 94 } | 98 } |
| 95 | 99 |
| 96 | 100 |
| 97 void LCodeGen::Comment(const char* format, ...) { | 101 void LCodeGen::Comment(const char* format, ...) { |
| (...skipping 4909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5007 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5011 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
| 5008 ASSERT(instr->temp()->Equals(instr->result())); | 5012 ASSERT(instr->temp()->Equals(instr->result())); |
| 5009 Register prototype_reg = ToRegister(instr->temp()); | 5013 Register prototype_reg = ToRegister(instr->temp()); |
| 5010 Register map_reg = ToRegister(instr->temp2()); | 5014 Register map_reg = ToRegister(instr->temp2()); |
| 5011 | 5015 |
| 5012 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5016 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
| 5013 ZoneList<Handle<Map> >* maps = instr->maps(); | 5017 ZoneList<Handle<Map> >* maps = instr->maps(); |
| 5014 | 5018 |
| 5015 ASSERT(prototypes->length() == maps->length()); | 5019 ASSERT(prototypes->length() == maps->length()); |
| 5016 | 5020 |
| 5017 for (int i = 0; i < prototypes->length(); i++) { | 5021 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
| 5018 __ LoadHeapObject(prototype_reg, prototypes->at(i)); | 5022 for (int i = 0; i < maps->length(); i++) { |
| 5019 __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); | 5023 prototype_maps_.Add(maps->at(i), info()->zone()); |
| 5020 DoCheckMapCommon(map_reg, | 5024 } |
| 5021 maps->at(i), | 5025 __ LoadHeapObject(prototype_reg, |
| 5022 ALLOW_ELEMENT_TRANSITION_MAPS, | 5026 prototypes->at(prototypes->length() - 1)); |
| 5023 instr->environment()); | 5027 } else { |
| 5028 for (int i = 0; i < prototypes->length(); i++) { |
| 5029 __ LoadHeapObject(prototype_reg, prototypes->at(i)); |
| 5030 __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
| 5031 DoCheckMapCommon(map_reg, |
| 5032 maps->at(i), |
| 5033 ALLOW_ELEMENT_TRANSITION_MAPS, |
| 5034 instr->environment()); |
| 5035 } |
| 5024 } | 5036 } |
| 5025 } | 5037 } |
| 5026 | 5038 |
| 5027 | 5039 |
| 5028 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 5040 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
| 5029 class DeferredAllocateObject: public LDeferredCode { | 5041 class DeferredAllocateObject: public LDeferredCode { |
| 5030 public: | 5042 public: |
| 5031 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 5043 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
| 5032 : LDeferredCode(codegen), instr_(instr) { } | 5044 : LDeferredCode(codegen), instr_(instr) { } |
| 5033 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 5045 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5827 __ Subu(scratch, result, scratch); | 5839 __ Subu(scratch, result, scratch); |
| 5828 __ lw(result, FieldMemOperand(scratch, | 5840 __ lw(result, FieldMemOperand(scratch, |
| 5829 FixedArray::kHeaderSize - kPointerSize)); | 5841 FixedArray::kHeaderSize - kPointerSize)); |
| 5830 __ bind(&done); | 5842 __ bind(&done); |
| 5831 } | 5843 } |
| 5832 | 5844 |
| 5833 | 5845 |
| 5834 #undef __ | 5846 #undef __ |
| 5835 | 5847 |
| 5836 } } // namespace v8::internal | 5848 } } // namespace v8::internal |
| OLD | NEW |