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 3049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3060 for (int i = 0; i < map_count; ++i) { | 3060 for (int i = 0; i < map_count; ++i) { |
3061 if (!CompactEmit(instr->hydrogen()->types(), name, i, isolate())) { | 3061 if (!CompactEmit(instr->hydrogen()->types(), name, i, isolate())) { |
3062 all_are_compact = false; | 3062 all_are_compact = false; |
3063 break; | 3063 break; |
3064 } | 3064 } |
3065 } | 3065 } |
3066 for (int i = 0; i < map_count; ++i) { | 3066 for (int i = 0; i < map_count; ++i) { |
3067 bool last = (i == map_count - 1); | 3067 bool last = (i == map_count - 1); |
3068 Handle<Map> map = instr->hydrogen()->types()->at(i); | 3068 Handle<Map> map = instr->hydrogen()->types()->at(i); |
3069 Label check_passed; | 3069 Label check_passed; |
3070 __ CompareMap(object, map, &check_passed, ALLOW_ELEMENT_TRANSITION_MAPS); | 3070 __ CompareMap(object, map, &check_passed); |
3071 if (last && !need_generic) { | 3071 if (last && !need_generic) { |
3072 DeoptimizeIf(not_equal, instr->environment()); | 3072 DeoptimizeIf(not_equal, instr->environment()); |
3073 __ bind(&check_passed); | 3073 __ bind(&check_passed); |
3074 EmitLoadFieldOrConstantFunction( | 3074 EmitLoadFieldOrConstantFunction( |
3075 result, object, map, name, instr->environment()); | 3075 result, object, map, name, instr->environment()); |
3076 } else { | 3076 } else { |
3077 Label next; | 3077 Label next; |
3078 bool compact = all_are_compact ? true : | 3078 bool compact = all_are_compact ? true : |
3079 CompactEmit(instr->hydrogen()->types(), name, i, isolate()); | 3079 CompactEmit(instr->hydrogen()->types(), name, i, isolate()); |
3080 __ j(not_equal, &next, compact ? Label::kNear : Label::kFar); | 3080 __ j(not_equal, &next, compact ? Label::kNear : Label::kFar); |
(...skipping 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5658 } else { | 5658 } else { |
5659 Operand operand = ToOperand(instr->value()); | 5659 Operand operand = ToOperand(instr->value()); |
5660 __ cmp(operand, target); | 5660 __ cmp(operand, target); |
5661 } | 5661 } |
5662 DeoptimizeIf(not_equal, instr->environment()); | 5662 DeoptimizeIf(not_equal, instr->environment()); |
5663 } | 5663 } |
5664 | 5664 |
5665 | 5665 |
5666 void LCodeGen::DoCheckMapCommon(Register reg, | 5666 void LCodeGen::DoCheckMapCommon(Register reg, |
5667 Handle<Map> map, | 5667 Handle<Map> map, |
5668 CompareMapMode mode, | |
5669 LInstruction* instr) { | 5668 LInstruction* instr) { |
5670 Label success; | 5669 Label success; |
5671 __ CompareMap(reg, map, &success, mode); | 5670 __ CompareMap(reg, map, &success); |
5672 DeoptimizeIf(not_equal, instr->environment()); | 5671 DeoptimizeIf(not_equal, instr->environment()); |
5673 __ bind(&success); | 5672 __ bind(&success); |
5674 } | 5673 } |
5675 | 5674 |
5676 | 5675 |
5677 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 5676 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
5678 LOperand* input = instr->value(); | 5677 LOperand* input = instr->value(); |
5679 ASSERT(input->IsRegister()); | 5678 ASSERT(input->IsRegister()); |
5680 Register reg = ToRegister(input); | 5679 Register reg = ToRegister(input); |
5681 | 5680 |
5682 Label success; | 5681 Label success; |
5683 SmallMapList* map_set = instr->hydrogen()->map_set(); | 5682 SmallMapList* map_set = instr->hydrogen()->map_set(); |
5684 for (int i = 0; i < map_set->length() - 1; i++) { | 5683 for (int i = 0; i < map_set->length() - 1; i++) { |
5685 Handle<Map> map = map_set->at(i); | 5684 Handle<Map> map = map_set->at(i); |
5686 __ CompareMap(reg, map, &success, REQUIRE_EXACT_MAP); | 5685 __ CompareMap(reg, map, &success); |
5687 __ j(equal, &success); | 5686 __ j(equal, &success); |
5688 } | 5687 } |
5689 Handle<Map> map = map_set->last(); | 5688 Handle<Map> map = map_set->last(); |
5690 DoCheckMapCommon(reg, map, REQUIRE_EXACT_MAP, instr); | 5689 DoCheckMapCommon(reg, map, instr); |
5691 __ bind(&success); | 5690 __ bind(&success); |
5692 } | 5691 } |
5693 | 5692 |
5694 | 5693 |
5695 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 5694 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
5696 CpuFeatureScope scope(masm(), SSE2); | 5695 CpuFeatureScope scope(masm(), SSE2); |
5697 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); | 5696 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); |
5698 Register result_reg = ToRegister(instr->result()); | 5697 Register result_reg = ToRegister(instr->result()); |
5699 __ ClampDoubleToUint8(value_reg, xmm0, result_reg); | 5698 __ ClampDoubleToUint8(value_reg, xmm0, result_reg); |
5700 } | 5699 } |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5872 | 5871 |
5873 ASSERT(prototypes->length() == maps->length()); | 5872 ASSERT(prototypes->length() == maps->length()); |
5874 | 5873 |
5875 if (instr->hydrogen()->CanOmitPrototypeChecks()) { | 5874 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
5876 for (int i = 0; i < maps->length(); i++) { | 5875 for (int i = 0; i < maps->length(); i++) { |
5877 prototype_maps_.Add(maps->at(i), info()->zone()); | 5876 prototype_maps_.Add(maps->at(i), info()->zone()); |
5878 } | 5877 } |
5879 } else { | 5878 } else { |
5880 for (int i = 0; i < prototypes->length(); i++) { | 5879 for (int i = 0; i < prototypes->length(); i++) { |
5881 __ LoadHeapObject(reg, prototypes->at(i)); | 5880 __ LoadHeapObject(reg, prototypes->at(i)); |
5882 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); | 5881 DoCheckMapCommon(reg, maps->at(i), instr); |
5883 } | 5882 } |
5884 } | 5883 } |
5885 } | 5884 } |
5886 | 5885 |
5887 | 5886 |
5888 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 5887 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
5889 class DeferredAllocateObject: public LDeferredCode { | 5888 class DeferredAllocateObject: public LDeferredCode { |
5890 public: | 5889 public: |
5891 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 5890 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
5892 : LDeferredCode(codegen), instr_(instr) { } | 5891 : LDeferredCode(codegen), instr_(instr) { } |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6571 FixedArray::kHeaderSize - kPointerSize)); | 6570 FixedArray::kHeaderSize - kPointerSize)); |
6572 __ bind(&done); | 6571 __ bind(&done); |
6573 } | 6572 } |
6574 | 6573 |
6575 | 6574 |
6576 #undef __ | 6575 #undef __ |
6577 | 6576 |
6578 } } // namespace v8::internal | 6577 } } // namespace v8::internal |
6579 | 6578 |
6580 #endif // V8_TARGET_ARCH_IA32 | 6579 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |