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 2756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2767 for (int i = 0; i < map_count; ++i) { | 2767 for (int i = 0; i < map_count; ++i) { |
2768 if (!CompactEmit(instr->hydrogen()->types(), name, i, isolate())) { | 2768 if (!CompactEmit(instr->hydrogen()->types(), name, i, isolate())) { |
2769 all_are_compact = false; | 2769 all_are_compact = false; |
2770 break; | 2770 break; |
2771 } | 2771 } |
2772 } | 2772 } |
2773 for (int i = 0; i < map_count; ++i) { | 2773 for (int i = 0; i < map_count; ++i) { |
2774 bool last = (i == map_count - 1); | 2774 bool last = (i == map_count - 1); |
2775 Handle<Map> map = instr->hydrogen()->types()->at(i); | 2775 Handle<Map> map = instr->hydrogen()->types()->at(i); |
2776 Label check_passed; | 2776 Label check_passed; |
2777 __ CompareMap(object, map, &check_passed, ALLOW_ELEMENT_TRANSITION_MAPS); | 2777 __ CompareMap(object, map, &check_passed); |
2778 if (last && !need_generic) { | 2778 if (last && !need_generic) { |
2779 DeoptimizeIf(not_equal, instr->environment()); | 2779 DeoptimizeIf(not_equal, instr->environment()); |
2780 __ bind(&check_passed); | 2780 __ bind(&check_passed); |
2781 EmitLoadFieldOrConstantFunction( | 2781 EmitLoadFieldOrConstantFunction( |
2782 result, object, map, name, instr->environment()); | 2782 result, object, map, name, instr->environment()); |
2783 } else { | 2783 } else { |
2784 Label next; | 2784 Label next; |
2785 bool compact = all_are_compact ? true : | 2785 bool compact = all_are_compact ? true : |
2786 CompactEmit(instr->hydrogen()->types(), name, i, isolate()); | 2786 CompactEmit(instr->hydrogen()->types(), name, i, isolate()); |
2787 __ j(not_equal, &next, compact ? Label::kNear : Label::kFar); | 2787 __ j(not_equal, &next, compact ? Label::kNear : Label::kFar); |
(...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4893 __ cmpq(reg, Operand(kScratchRegister, 0)); | 4893 __ cmpq(reg, Operand(kScratchRegister, 0)); |
4894 } else { | 4894 } else { |
4895 __ Cmp(reg, target); | 4895 __ Cmp(reg, target); |
4896 } | 4896 } |
4897 DeoptimizeIf(not_equal, instr->environment()); | 4897 DeoptimizeIf(not_equal, instr->environment()); |
4898 } | 4898 } |
4899 | 4899 |
4900 | 4900 |
4901 void LCodeGen::DoCheckMapCommon(Register reg, | 4901 void LCodeGen::DoCheckMapCommon(Register reg, |
4902 Handle<Map> map, | 4902 Handle<Map> map, |
4903 CompareMapMode mode, | |
4904 LInstruction* instr) { | 4903 LInstruction* instr) { |
4905 Label success; | 4904 Label success; |
4906 __ CompareMap(reg, map, &success, mode); | 4905 __ CompareMap(reg, map, &success); |
4907 DeoptimizeIf(not_equal, instr->environment()); | 4906 DeoptimizeIf(not_equal, instr->environment()); |
4908 __ bind(&success); | 4907 __ bind(&success); |
4909 } | 4908 } |
4910 | 4909 |
4911 | 4910 |
4912 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 4911 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
4913 LOperand* input = instr->value(); | 4912 LOperand* input = instr->value(); |
4914 ASSERT(input->IsRegister()); | 4913 ASSERT(input->IsRegister()); |
4915 Register reg = ToRegister(input); | 4914 Register reg = ToRegister(input); |
4916 | 4915 |
4917 Label success; | 4916 Label success; |
4918 SmallMapList* map_set = instr->hydrogen()->map_set(); | 4917 SmallMapList* map_set = instr->hydrogen()->map_set(); |
4919 for (int i = 0; i < map_set->length() - 1; i++) { | 4918 for (int i = 0; i < map_set->length() - 1; i++) { |
4920 Handle<Map> map = map_set->at(i); | 4919 Handle<Map> map = map_set->at(i); |
4921 __ CompareMap(reg, map, &success, REQUIRE_EXACT_MAP); | 4920 __ CompareMap(reg, map, &success); |
4922 __ j(equal, &success); | 4921 __ j(equal, &success); |
4923 } | 4922 } |
4924 Handle<Map> map = map_set->last(); | 4923 Handle<Map> map = map_set->last(); |
4925 DoCheckMapCommon(reg, map, REQUIRE_EXACT_MAP, instr); | 4924 DoCheckMapCommon(reg, map, instr); |
4926 __ bind(&success); | 4925 __ bind(&success); |
4927 } | 4926 } |
4928 | 4927 |
4929 | 4928 |
4930 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 4929 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
4931 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); | 4930 XMMRegister value_reg = ToDoubleRegister(instr->unclamped()); |
4932 Register result_reg = ToRegister(instr->result()); | 4931 Register result_reg = ToRegister(instr->result()); |
4933 __ ClampDoubleToUint8(value_reg, xmm0, result_reg); | 4932 __ ClampDoubleToUint8(value_reg, xmm0, result_reg); |
4934 } | 4933 } |
4935 | 4934 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4984 | 4983 |
4985 ASSERT(prototypes->length() == maps->length()); | 4984 ASSERT(prototypes->length() == maps->length()); |
4986 | 4985 |
4987 if (instr->hydrogen()->CanOmitPrototypeChecks()) { | 4986 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
4988 for (int i = 0; i < maps->length(); i++) { | 4987 for (int i = 0; i < maps->length(); i++) { |
4989 prototype_maps_.Add(maps->at(i), info()->zone()); | 4988 prototype_maps_.Add(maps->at(i), info()->zone()); |
4990 } | 4989 } |
4991 } else { | 4990 } else { |
4992 for (int i = 0; i < prototypes->length(); i++) { | 4991 for (int i = 0; i < prototypes->length(); i++) { |
4993 __ LoadHeapObject(reg, prototypes->at(i)); | 4992 __ LoadHeapObject(reg, prototypes->at(i)); |
4994 DoCheckMapCommon(reg, maps->at(i), ALLOW_ELEMENT_TRANSITION_MAPS, instr); | 4993 DoCheckMapCommon(reg, maps->at(i), instr); |
4995 } | 4994 } |
4996 } | 4995 } |
4997 } | 4996 } |
4998 | 4997 |
4999 | 4998 |
5000 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 4999 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
5001 class DeferredAllocateObject: public LDeferredCode { | 5000 class DeferredAllocateObject: public LDeferredCode { |
5002 public: | 5001 public: |
5003 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 5002 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
5004 : LDeferredCode(codegen), instr_(instr) { } | 5003 : LDeferredCode(codegen), instr_(instr) { } |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5688 FixedArray::kHeaderSize - kPointerSize)); | 5687 FixedArray::kHeaderSize - kPointerSize)); |
5689 __ bind(&done); | 5688 __ bind(&done); |
5690 } | 5689 } |
5691 | 5690 |
5692 | 5691 |
5693 #undef __ | 5692 #undef __ |
5694 | 5693 |
5695 } } // namespace v8::internal | 5694 } } // namespace v8::internal |
5696 | 5695 |
5697 #endif // V8_TARGET_ARCH_X64 | 5696 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |