OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 4136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4148 __ mov(ip, Operand(Handle<Object>(cell))); | 4148 __ mov(ip, Operand(Handle<Object>(cell))); |
4149 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); | 4149 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); |
4150 __ cmp(reg, ip); | 4150 __ cmp(reg, ip); |
4151 } else { | 4151 } else { |
4152 __ cmp(reg, Operand(target)); | 4152 __ cmp(reg, Operand(target)); |
4153 } | 4153 } |
4154 DeoptimizeIf(ne, instr->environment()); | 4154 DeoptimizeIf(ne, instr->environment()); |
4155 } | 4155 } |
4156 | 4156 |
4157 | 4157 |
4158 void LCodeGen::DoCheckMapCommon(Register reg, | |
4159 Register scratch, | |
4160 Handle<Map> map, | |
4161 CompareMapMode mode, | |
4162 LEnvironment* env) { | |
4163 Label success; | |
4164 __ CompareMap(reg, scratch, map, &success, mode); | |
4165 DeoptimizeIf(ne, env); | |
4166 __ bind(&success); | |
4167 } | |
4168 | |
4169 | |
4170 void LCodeGen::DoCheckMap(LCheckMap* instr) { | 4158 void LCodeGen::DoCheckMap(LCheckMap* instr) { |
4171 Register scratch = scratch0(); | 4159 Register scratch = scratch0(); |
4172 LOperand* input = instr->InputAt(0); | 4160 LOperand* input = instr->InputAt(0); |
4173 ASSERT(input->IsRegister()); | 4161 ASSERT(input->IsRegister()); |
4174 Register reg = ToRegister(input); | 4162 Register reg = ToRegister(input); |
4175 Handle<Map> map = instr->hydrogen()->map(); | 4163 __ ldr(scratch, FieldMemOperand(reg, HeapObject::kMapOffset)); |
4176 DoCheckMapCommon(reg, scratch, map, instr->hydrogen()->mode(), | 4164 __ cmp(scratch, Operand(instr->hydrogen()->map())); |
4177 instr->environment()); | 4165 DeoptimizeIf(ne, instr->environment()); |
4178 } | 4166 } |
4179 | 4167 |
4180 | 4168 |
4181 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 4169 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
4182 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); | 4170 DoubleRegister value_reg = ToDoubleRegister(instr->unclamped()); |
4183 Register result_reg = ToRegister(instr->result()); | 4171 Register result_reg = ToRegister(instr->result()); |
4184 DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0)); | 4172 DoubleRegister temp_reg = ToDoubleRegister(instr->TempAt(0)); |
4185 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); | 4173 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); |
4186 } | 4174 } |
4187 | 4175 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4236 Register temp2 = ToRegister(instr->TempAt(1)); | 4224 Register temp2 = ToRegister(instr->TempAt(1)); |
4237 | 4225 |
4238 Handle<JSObject> holder = instr->holder(); | 4226 Handle<JSObject> holder = instr->holder(); |
4239 Handle<JSObject> current_prototype = instr->prototype(); | 4227 Handle<JSObject> current_prototype = instr->prototype(); |
4240 | 4228 |
4241 // Load prototype object. | 4229 // Load prototype object. |
4242 __ LoadHeapObject(temp1, current_prototype); | 4230 __ LoadHeapObject(temp1, current_prototype); |
4243 | 4231 |
4244 // Check prototype maps up to the holder. | 4232 // Check prototype maps up to the holder. |
4245 while (!current_prototype.is_identical_to(holder)) { | 4233 while (!current_prototype.is_identical_to(holder)) { |
4246 DoCheckMapCommon(temp1, temp2, | 4234 __ ldr(temp2, FieldMemOperand(temp1, HeapObject::kMapOffset)); |
4247 Handle<Map>(current_prototype->map()), | 4235 __ cmp(temp2, Operand(Handle<Map>(current_prototype->map()))); |
4248 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); | 4236 DeoptimizeIf(ne, instr->environment()); |
4249 current_prototype = | 4237 current_prototype = |
4250 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); | 4238 Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); |
4251 // Load next prototype object. | 4239 // Load next prototype object. |
4252 __ LoadHeapObject(temp1, current_prototype); | 4240 __ LoadHeapObject(temp1, current_prototype); |
4253 } | 4241 } |
4254 | 4242 |
4255 // Check the holder map. | 4243 // Check the holder map. |
4256 DoCheckMapCommon(temp1, temp2, | 4244 __ ldr(temp2, FieldMemOperand(temp1, HeapObject::kMapOffset)); |
4257 Handle<Map>(current_prototype->map()), | 4245 __ cmp(temp2, Operand(Handle<Map>(current_prototype->map()))); |
4258 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); | |
4259 DeoptimizeIf(ne, instr->environment()); | 4246 DeoptimizeIf(ne, instr->environment()); |
4260 } | 4247 } |
4261 | 4248 |
4262 | 4249 |
4263 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { | 4250 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { |
4264 Heap* heap = isolate()->heap(); | 4251 Heap* heap = isolate()->heap(); |
4265 ElementsKind boilerplate_elements_kind = | 4252 ElementsKind boilerplate_elements_kind = |
4266 instr->hydrogen()->boilerplate_elements_kind(); | 4253 instr->hydrogen()->boilerplate_elements_kind(); |
4267 | 4254 |
4268 // Deopt if the array literal boilerplate ElementsKind is of a type different | 4255 // Deopt if the array literal boilerplate ElementsKind is of a type different |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4745 ASSERT(osr_pc_offset_ == -1); | 4732 ASSERT(osr_pc_offset_ == -1); |
4746 osr_pc_offset_ = masm()->pc_offset(); | 4733 osr_pc_offset_ = masm()->pc_offset(); |
4747 } | 4734 } |
4748 | 4735 |
4749 | 4736 |
4750 | 4737 |
4751 | 4738 |
4752 #undef __ | 4739 #undef __ |
4753 | 4740 |
4754 } } // namespace v8::internal | 4741 } } // namespace v8::internal |
OLD | NEW |