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 5784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5795 Handle<Map> map, | 5795 Handle<Map> map, |
5796 LInstruction* instr) { | 5796 LInstruction* instr) { |
5797 Label success; | 5797 Label success; |
5798 __ CompareMap(reg, map, &success); | 5798 __ CompareMap(reg, map, &success); |
5799 DeoptimizeIf(not_equal, instr->environment()); | 5799 DeoptimizeIf(not_equal, instr->environment()); |
5800 __ bind(&success); | 5800 __ bind(&success); |
5801 } | 5801 } |
5802 | 5802 |
5803 | 5803 |
5804 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 5804 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
| 5805 if (instr->hydrogen()->CanOmitMapChecks()) return; |
5805 LOperand* input = instr->value(); | 5806 LOperand* input = instr->value(); |
5806 ASSERT(input->IsRegister()); | 5807 ASSERT(input->IsRegister()); |
5807 Register reg = ToRegister(input); | 5808 Register reg = ToRegister(input); |
5808 | 5809 |
5809 Label success; | 5810 Label success; |
5810 SmallMapList* map_set = instr->hydrogen()->map_set(); | 5811 SmallMapList* map_set = instr->hydrogen()->map_set(); |
5811 for (int i = 0; i < map_set->length() - 1; i++) { | 5812 for (int i = 0; i < map_set->length() - 1; i++) { |
5812 Handle<Map> map = map_set->at(i); | 5813 Handle<Map> map = map_set->at(i); |
5813 __ CompareMap(reg, map, &success); | 5814 __ CompareMap(reg, map, &success); |
5814 __ j(equal, &success); | 5815 __ j(equal, &success); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5985 if (!input_reg.is(result_reg)) { | 5986 if (!input_reg.is(result_reg)) { |
5986 __ mov(result_reg, input_reg); | 5987 __ mov(result_reg, input_reg); |
5987 } | 5988 } |
5988 __ SmiUntag(result_reg); | 5989 __ SmiUntag(result_reg); |
5989 __ ClampUint8(result_reg); | 5990 __ ClampUint8(result_reg); |
5990 __ bind(&done); | 5991 __ bind(&done); |
5991 } | 5992 } |
5992 | 5993 |
5993 | 5994 |
5994 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5995 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
| 5996 if (instr->hydrogen()->CanOmitPrototypeChecks()) return; |
5995 Register reg = ToRegister(instr->temp()); | 5997 Register reg = ToRegister(instr->temp()); |
5996 | 5998 |
5997 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5999 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
5998 ZoneList<Handle<Map> >* maps = instr->maps(); | 6000 ZoneList<Handle<Map> >* maps = instr->maps(); |
5999 | 6001 |
6000 ASSERT(prototypes->length() == maps->length()); | 6002 ASSERT(prototypes->length() == maps->length()); |
6001 | 6003 |
6002 if (!instr->hydrogen()->CanOmitPrototypeChecks()) { | 6004 for (int i = 0; i < prototypes->length(); i++) { |
6003 for (int i = 0; i < prototypes->length(); i++) { | 6005 __ LoadHeapObject(reg, prototypes->at(i)); |
6004 __ LoadHeapObject(reg, prototypes->at(i)); | 6006 DoCheckMapCommon(reg, maps->at(i), instr); |
6005 DoCheckMapCommon(reg, maps->at(i), instr); | |
6006 } | |
6007 } | 6007 } |
6008 } | 6008 } |
6009 | 6009 |
6010 | 6010 |
6011 void LCodeGen::DoAllocate(LAllocate* instr) { | 6011 void LCodeGen::DoAllocate(LAllocate* instr) { |
6012 class DeferredAllocate: public LDeferredCode { | 6012 class DeferredAllocate: public LDeferredCode { |
6013 public: | 6013 public: |
6014 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 6014 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
6015 : LDeferredCode(codegen), instr_(instr) { } | 6015 : LDeferredCode(codegen), instr_(instr) { } |
6016 virtual void Generate() { codegen()->DoDeferredAllocate(instr_); } | 6016 virtual void Generate() { codegen()->DoDeferredAllocate(instr_); } |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6501 FixedArray::kHeaderSize - kPointerSize)); | 6501 FixedArray::kHeaderSize - kPointerSize)); |
6502 __ bind(&done); | 6502 __ bind(&done); |
6503 } | 6503 } |
6504 | 6504 |
6505 | 6505 |
6506 #undef __ | 6506 #undef __ |
6507 | 6507 |
6508 } } // namespace v8::internal | 6508 } } // namespace v8::internal |
6509 | 6509 |
6510 #endif // V8_TARGET_ARCH_IA32 | 6510 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |