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 4760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4771 __ ClampUint8(input_reg); | 4771 __ ClampUint8(input_reg); |
4772 | 4772 |
4773 __ bind(&done); | 4773 __ bind(&done); |
4774 } | 4774 } |
4775 | 4775 |
4776 | 4776 |
4777 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 4777 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
4778 ASSERT(instr->temp()->Equals(instr->result())); | 4778 ASSERT(instr->temp()->Equals(instr->result())); |
4779 Register reg = ToRegister(instr->temp()); | 4779 Register reg = ToRegister(instr->temp()); |
4780 | 4780 |
4781 Handle<JSObject> holder = instr->holder(); | 4781 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
4782 Handle<JSObject> current_prototype = instr->prototype(); | 4782 ZoneList<Handle<Map> >* maps = instr->maps(); |
4783 | 4783 |
4784 // Load prototype object. | 4784 ASSERT(prototypes->length() == maps->length()); |
4785 __ LoadHeapObject(reg, current_prototype); | |
4786 | 4785 |
4787 // Check prototype maps up to the holder. | 4786 for (int i = 0; i < prototypes->length(); i++) { |
4788 while (!current_prototype.is_identical_to(holder)) { | 4787 __ LoadHeapObject(reg, prototypes->at(i)); |
4789 DoCheckMapCommon(reg, Handle<Map>(current_prototype->map()), | 4788 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); |
4790 ALLOW_ELEMENT_TRANSITION_MAPS, instr); | |
4791 current_prototype = | |
4792 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); | |
4793 // Load next prototype object. | |
4794 __ LoadHeapObject(reg, current_prototype); | |
4795 } | 4789 } |
4796 | |
4797 // Check the holder map. | |
4798 DoCheckMapCommon(reg, Handle<Map>(current_prototype->map()), | |
4799 ALLOW_ELEMENT_TRANSITION_MAPS, instr); | |
4800 } | 4790 } |
4801 | 4791 |
4802 | 4792 |
4803 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 4793 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
4804 class DeferredAllocateObject: public LDeferredCode { | 4794 class DeferredAllocateObject: public LDeferredCode { |
4805 public: | 4795 public: |
4806 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 4796 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
4807 : LDeferredCode(codegen), instr_(instr) { } | 4797 : LDeferredCode(codegen), instr_(instr) { } |
4808 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 4798 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
4809 virtual LInstruction* instr() { return instr_; } | 4799 virtual LInstruction* instr() { return instr_; } |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5577 FixedArray::kHeaderSize - kPointerSize)); | 5567 FixedArray::kHeaderSize - kPointerSize)); |
5578 __ bind(&done); | 5568 __ bind(&done); |
5579 } | 5569 } |
5580 | 5570 |
5581 | 5571 |
5582 #undef __ | 5572 #undef __ |
5583 | 5573 |
5584 } } // namespace v8::internal | 5574 } } // namespace v8::internal |
5585 | 5575 |
5586 #endif // V8_TARGET_ARCH_X64 | 5576 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |