Chromium Code Reviews| 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 4810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4821 __ mov(ip, Operand(Handle<Object>(cell))); | 4821 __ mov(ip, Operand(Handle<Object>(cell))); |
| 4822 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); | 4822 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); |
| 4823 __ cmp(reg, ip); | 4823 __ cmp(reg, ip); |
| 4824 } else { | 4824 } else { |
| 4825 __ cmp(reg, Operand(target)); | 4825 __ cmp(reg, Operand(target)); |
| 4826 } | 4826 } |
| 4827 DeoptimizeIf(ne, instr->environment()); | 4827 DeoptimizeIf(ne, instr->environment()); |
| 4828 } | 4828 } |
| 4829 | 4829 |
| 4830 | 4830 |
| 4831 void LCodeGen::DoCheckMapCommon(Register reg, | 4831 void LCodeGen::DoCheckMapCommon(Register scratch, |
|
danno
2012/12/07 10:47:11
can you please rename this to map_reg here and els
| |
| 4832 Register scratch, | |
| 4833 Handle<Map> map, | 4832 Handle<Map> map, |
| 4834 CompareMapMode mode, | 4833 CompareMapMode mode, |
| 4835 LEnvironment* env) { | 4834 LEnvironment* env) { |
| 4836 Label success; | 4835 Label success; |
| 4837 __ CompareMap(reg, scratch, map, &success, mode); | 4836 __ CompareMap(scratch, map, &success, mode); |
| 4838 DeoptimizeIf(ne, env); | 4837 DeoptimizeIf(ne, env); |
| 4839 __ bind(&success); | 4838 __ bind(&success); |
| 4840 } | 4839 } |
| 4841 | 4840 |
| 4842 | 4841 |
| 4843 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 4842 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
| 4844 Register scratch = scratch0(); | 4843 Register scratch = scratch0(); |
| 4845 LOperand* input = instr->value(); | 4844 LOperand* input = instr->value(); |
| 4846 ASSERT(input->IsRegister()); | 4845 ASSERT(input->IsRegister()); |
| 4847 Register reg = ToRegister(input); | 4846 Register reg = ToRegister(input); |
| 4848 | 4847 |
| 4849 Label success; | 4848 Label success; |
| 4850 SmallMapList* map_set = instr->hydrogen()->map_set(); | 4849 SmallMapList* map_set = instr->hydrogen()->map_set(); |
| 4850 __ ldr(scratch, FieldMemOperand(reg, HeapObject::kMapOffset)); | |
|
danno
2012/12/07 10:47:11
can you please rename this to map_reg here and els
| |
| 4851 for (int i = 0; i < map_set->length() - 1; i++) { | 4851 for (int i = 0; i < map_set->length() - 1; i++) { |
| 4852 Handle<Map> map = map_set->at(i); | 4852 Handle<Map> map = map_set->at(i); |
| 4853 __ CompareMap(reg, scratch, map, &success, REQUIRE_EXACT_MAP); | 4853 __ CompareMap(scratch, map, &success, REQUIRE_EXACT_MAP); |
| 4854 __ b(eq, &success); | 4854 __ b(eq, &success); |
| 4855 } | 4855 } |
| 4856 Handle<Map> map = map_set->last(); | 4856 Handle<Map> map = map_set->last(); |
| 4857 DoCheckMapCommon(reg, scratch, map, REQUIRE_EXACT_MAP, instr->environment()); | 4857 DoCheckMapCommon(scratch, map, REQUIRE_EXACT_MAP, instr->environment()); |
| 4858 __ bind(&success); | 4858 __ bind(&success); |
| 4859 } | 4859 } |
| 4860 | 4860 |
| 4861 | 4861 |
| 4862 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 4862 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
| 4863 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); | 4863 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); |
| 4864 Register result_reg = ToRegister(instr->result()); | 4864 Register result_reg = ToRegister(instr->result()); |
| 4865 DoubleRegister temp_reg = ToDoubleRegister(instr->temp()); | 4865 DoubleRegister temp_reg = ToDoubleRegister(instr->temp()); |
| 4866 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); | 4866 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); |
| 4867 } | 4867 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4916 Register temp2 = ToRegister(instr->temp2()); | 4916 Register temp2 = ToRegister(instr->temp2()); |
| 4917 | 4917 |
| 4918 Handle<JSObject> holder = instr->holder(); | 4918 Handle<JSObject> holder = instr->holder(); |
| 4919 Handle<JSObject> current_prototype = instr->prototype(); | 4919 Handle<JSObject> current_prototype = instr->prototype(); |
| 4920 | 4920 |
| 4921 // Load prototype object. | 4921 // Load prototype object. |
| 4922 __ LoadHeapObject(temp1, current_prototype); | 4922 __ LoadHeapObject(temp1, current_prototype); |
| 4923 | 4923 |
| 4924 // Check prototype maps up to the holder. | 4924 // Check prototype maps up to the holder. |
| 4925 while (!current_prototype.is_identical_to(holder)) { | 4925 while (!current_prototype.is_identical_to(holder)) { |
| 4926 DoCheckMapCommon(temp1, temp2, | 4926 __ ldr(temp2, FieldMemOperand(temp1, HeapObject::kMapOffset)); |
| 4927 DoCheckMapCommon(temp2, | |
| 4927 Handle<Map>(current_prototype->map()), | 4928 Handle<Map>(current_prototype->map()), |
| 4928 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); | 4929 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); |
| 4929 current_prototype = | 4930 current_prototype = |
| 4930 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); | 4931 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); |
| 4931 // Load next prototype object. | 4932 // Load next prototype object. |
| 4932 __ LoadHeapObject(temp1, current_prototype); | 4933 __ LoadHeapObject(temp1, current_prototype); |
| 4933 } | 4934 } |
| 4934 | 4935 |
| 4935 // Check the holder map. | 4936 // Check the holder map. |
| 4936 DoCheckMapCommon(temp1, temp2, | 4937 DoCheckMapCommon(temp2, |
| 4937 Handle<Map>(current_prototype->map()), | 4938 Handle<Map>(current_prototype->map()), |
| 4938 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); | 4939 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); |
| 4939 DeoptimizeIf(ne, instr->environment()); | 4940 DeoptimizeIf(ne, instr->environment()); |
| 4940 } | 4941 } |
| 4941 | 4942 |
| 4942 | 4943 |
| 4943 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 4944 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
| 4944 class DeferredAllocateObject: public LDeferredCode { | 4945 class DeferredAllocateObject: public LDeferredCode { |
| 4945 public: | 4946 public: |
| 4946 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 4947 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5680 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5681 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5681 __ ldr(result, FieldMemOperand(scratch, | 5682 __ ldr(result, FieldMemOperand(scratch, |
| 5682 FixedArray::kHeaderSize - kPointerSize)); | 5683 FixedArray::kHeaderSize - kPointerSize)); |
| 5683 __ bind(&done); | 5684 __ bind(&done); |
| 5684 } | 5685 } |
| 5685 | 5686 |
| 5686 | 5687 |
| 5687 #undef __ | 5688 #undef __ |
| 5688 | 5689 |
| 5689 } } // namespace v8::internal | 5690 } } // namespace v8::internal |
| OLD | NEW |