Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 11552017: Revert "Remove redundant loads in DoCheckMaps" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 map_reg, 4948 void LCodeGen::DoCheckMapCommon(Register reg,
4949 Register scratch,
4949 Handle<Map> map, 4950 Handle<Map> map,
4950 CompareMapMode mode, 4951 CompareMapMode mode,
4951 LEnvironment* env) { 4952 LEnvironment* env) {
4952 Label success; 4953 Label success;
4953 __ CompareMap(map_reg, map, &success, mode); 4954 __ CompareMap(reg, scratch, map, &success, mode);
4954 DeoptimizeIf(ne, env); 4955 DeoptimizeIf(ne, env);
4955 __ bind(&success); 4956 __ bind(&success);
4956 } 4957 }
4957 4958
4958 4959
4959 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { 4960 void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
4960 Register map_reg = scratch0(); 4961 Register scratch = scratch0();
4961 LOperand* input = instr->value(); 4962 LOperand* input = instr->value();
4962 ASSERT(input->IsRegister()); 4963 ASSERT(input->IsRegister());
4963 Register reg = ToRegister(input); 4964 Register reg = ToRegister(input);
4964 4965
4965 Label success; 4966 Label success;
4966 SmallMapList* map_set = instr->hydrogen()->map_set(); 4967 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(map_reg, map, &success, REQUIRE_EXACT_MAP); 4970 __ CompareMap(reg, scratch, 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(map_reg, map, REQUIRE_EXACT_MAP, instr->environment()); 4974 DoCheckMapCommon(reg, scratch, 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
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 prototype_reg = ToRegister(instr->temp()); 5033 Register temp1 = ToRegister(instr->temp());
5034 Register map_reg = ToRegister(instr->temp2()); 5034 Register temp2 = 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(prototype_reg, current_prototype); 5040 __ LoadHeapObject(temp1, 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 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); 5044 DoCheckMapCommon(temp1, temp2,
5045 DoCheckMapCommon(map_reg,
5046 Handle<Map>(current_prototype->map()), 5045 Handle<Map>(current_prototype->map()),
5047 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); 5046 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment());
5048 current_prototype = 5047 current_prototype =
5049 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); 5048 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype()));
5050 // Load next prototype object. 5049 // Load next prototype object.
5051 __ LoadHeapObject(prototype_reg, current_prototype); 5050 __ LoadHeapObject(temp1, current_prototype);
5052 } 5051 }
5053 5052
5054 // Check the holder map. 5053 // Check the holder map.
5055 DoCheckMapCommon(map_reg, 5054 DoCheckMapCommon(temp1, temp2,
5056 Handle<Map>(current_prototype->map()), 5055 Handle<Map>(current_prototype->map()),
5057 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); 5056 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment());
5058 } 5057 }
5059 5058
5060 5059
5061 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { 5060 void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
5062 class DeferredAllocateObject: public LDeferredCode { 5061 class DeferredAllocateObject: public LDeferredCode {
5063 public: 5062 public:
5064 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) 5063 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr)
5065 : LDeferredCode(codegen), instr_(instr) { } 5064 : LDeferredCode(codegen), instr_(instr) { }
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
5797 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5796 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5798 __ ldr(result, FieldMemOperand(scratch, 5797 __ ldr(result, FieldMemOperand(scratch,
5799 FixedArray::kHeaderSize - kPointerSize)); 5798 FixedArray::kHeaderSize - kPointerSize));
5800 __ bind(&done); 5799 __ bind(&done);
5801 } 5800 }
5802 5801
5803 5802
5804 #undef __ 5803 #undef __
5805 5804
5806 } } // namespace v8::internal 5805 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698