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 4927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4938 __ mov(ip, Operand(Handle<Object>(cell))); | 4938 __ mov(ip, Operand(Handle<Object>(cell))); |
4939 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); | 4939 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); |
4940 __ cmp(reg, ip); | 4940 __ cmp(reg, ip); |
4941 } else { | 4941 } else { |
4942 __ cmp(reg, Operand(target)); | 4942 __ cmp(reg, Operand(target)); |
4943 } | 4943 } |
4944 DeoptimizeIf(ne, instr->environment()); | 4944 DeoptimizeIf(ne, instr->environment()); |
4945 } | 4945 } |
4946 | 4946 |
4947 | 4947 |
4948 void LCodeGen::DoCheckMapCommon(Register reg, | 4948 void LCodeGen::DoCheckMapCommon(Register map_reg, |
4949 Register scratch, | |
4950 Handle<Map> map, | 4949 Handle<Map> map, |
4951 CompareMapMode mode, | 4950 CompareMapMode mode, |
4952 LEnvironment* env) { | 4951 LEnvironment* env) { |
4953 Label success; | 4952 Label success; |
4954 __ CompareMap(reg, scratch, map, &success, mode); | 4953 __ CompareMap(map_reg, map, &success, mode); |
4955 DeoptimizeIf(ne, env); | 4954 DeoptimizeIf(ne, env); |
4956 __ bind(&success); | 4955 __ bind(&success); |
4957 } | 4956 } |
4958 | 4957 |
4959 | 4958 |
4960 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 4959 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
4961 Register scratch = scratch0(); | 4960 Register map_reg = scratch0(); |
4962 LOperand* input = instr->value(); | 4961 LOperand* input = instr->value(); |
4963 ASSERT(input->IsRegister()); | 4962 ASSERT(input->IsRegister()); |
4964 Register reg = ToRegister(input); | 4963 Register reg = ToRegister(input); |
4965 | 4964 |
4966 Label success; | 4965 Label success; |
4967 SmallMapList* map_set = instr->hydrogen()->map_set(); | 4966 SmallMapList* map_set = instr->hydrogen()->map_set(); |
| 4967 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
4968 for (int i = 0; i < map_set->length() - 1; i++) { | 4968 for (int i = 0; i < map_set->length() - 1; i++) { |
4969 Handle<Map> map = map_set->at(i); | 4969 Handle<Map> map = map_set->at(i); |
4970 __ CompareMap(reg, scratch, map, &success, REQUIRE_EXACT_MAP); | 4970 __ CompareMap(map_reg, map, &success, REQUIRE_EXACT_MAP); |
4971 __ b(eq, &success); | 4971 __ b(eq, &success); |
4972 } | 4972 } |
4973 Handle<Map> map = map_set->last(); | 4973 Handle<Map> map = map_set->last(); |
4974 DoCheckMapCommon(reg, scratch, map, REQUIRE_EXACT_MAP, instr->environment()); | 4974 DoCheckMapCommon(map_reg, map, REQUIRE_EXACT_MAP, instr->environment()); |
4975 __ bind(&success); | 4975 __ bind(&success); |
4976 } | 4976 } |
4977 | 4977 |
4978 | 4978 |
4979 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 4979 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
4980 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); | 4980 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); |
4981 Register result_reg = ToRegister(instr->result()); | 4981 Register result_reg = ToRegister(instr->result()); |
4982 DoubleRegister temp_reg = ToDoubleRegister(instr->temp()); | 4982 DoubleRegister temp_reg = ToDoubleRegister(instr->temp()); |
4983 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); | 4983 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); |
4984 } | 4984 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5023 // smi | 5023 // smi |
5024 __ bind(&is_smi); | 5024 __ bind(&is_smi); |
5025 __ ClampUint8(result_reg, result_reg); | 5025 __ ClampUint8(result_reg, result_reg); |
5026 | 5026 |
5027 __ bind(&done); | 5027 __ bind(&done); |
5028 } | 5028 } |
5029 | 5029 |
5030 | 5030 |
5031 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5031 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
5032 ASSERT(instr->temp()->Equals(instr->result())); | 5032 ASSERT(instr->temp()->Equals(instr->result())); |
5033 Register temp1 = ToRegister(instr->temp()); | 5033 Register prototype_reg = ToRegister(instr->temp()); |
5034 Register temp2 = ToRegister(instr->temp2()); | 5034 Register map_reg = ToRegister(instr->temp2()); |
5035 | 5035 |
5036 Handle<JSObject> holder = instr->holder(); | 5036 Handle<JSObject> holder = instr->holder(); |
5037 Handle<JSObject> current_prototype = instr->prototype(); | 5037 Handle<JSObject> current_prototype = instr->prototype(); |
5038 | 5038 |
5039 // Load prototype object. | 5039 // Load prototype object. |
5040 __ LoadHeapObject(temp1, current_prototype); | 5040 __ LoadHeapObject(prototype_reg, current_prototype); |
5041 | 5041 |
5042 // Check prototype maps up to the holder. | 5042 // Check prototype maps up to the holder. |
5043 while (!current_prototype.is_identical_to(holder)) { | 5043 while (!current_prototype.is_identical_to(holder)) { |
5044 DoCheckMapCommon(temp1, temp2, | 5044 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
| 5045 DoCheckMapCommon(map_reg, |
5045 Handle<Map>(current_prototype->map()), | 5046 Handle<Map>(current_prototype->map()), |
5046 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); | 5047 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); |
5047 current_prototype = | 5048 current_prototype = |
5048 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); | 5049 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); |
5049 // Load next prototype object. | 5050 // Load next prototype object. |
5050 __ LoadHeapObject(temp1, current_prototype); | 5051 __ LoadHeapObject(prototype_reg, current_prototype); |
5051 } | 5052 } |
5052 | 5053 |
5053 // Check the holder map. | 5054 // Check the holder map. |
5054 DoCheckMapCommon(temp1, temp2, | 5055 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
| 5056 DoCheckMapCommon(map_reg, |
5055 Handle<Map>(current_prototype->map()), | 5057 Handle<Map>(current_prototype->map()), |
5056 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); | 5058 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); |
5057 } | 5059 } |
5058 | 5060 |
5059 | 5061 |
5060 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 5062 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
5061 class DeferredAllocateObject: public LDeferredCode { | 5063 class DeferredAllocateObject: public LDeferredCode { |
5062 public: | 5064 public: |
5063 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 5065 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
5064 : LDeferredCode(codegen), instr_(instr) { } | 5066 : LDeferredCode(codegen), instr_(instr) { } |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5796 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5798 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5797 __ ldr(result, FieldMemOperand(scratch, | 5799 __ ldr(result, FieldMemOperand(scratch, |
5798 FixedArray::kHeaderSize - kPointerSize)); | 5800 FixedArray::kHeaderSize - kPointerSize)); |
5799 __ bind(&done); | 5801 __ bind(&done); |
5800 } | 5802 } |
5801 | 5803 |
5802 | 5804 |
5803 #undef __ | 5805 #undef __ |
5804 | 5806 |
5805 } } // namespace v8::internal | 5807 } } // namespace v8::internal |
OLD | NEW |