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 3129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3140 DeoptimizeIf(al, instr->environment()); | 3140 DeoptimizeIf(al, instr->environment()); |
3141 return; | 3141 return; |
3142 } | 3142 } |
3143 Handle<String> name = instr->hydrogen()->name(); | 3143 Handle<String> name = instr->hydrogen()->name(); |
3144 Label done; | 3144 Label done; |
3145 __ ldr(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); | 3145 __ ldr(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); |
3146 for (int i = 0; i < map_count; ++i) { | 3146 for (int i = 0; i < map_count; ++i) { |
3147 bool last = (i == map_count - 1); | 3147 bool last = (i == map_count - 1); |
3148 Handle<Map> map = instr->hydrogen()->types()->at(i); | 3148 Handle<Map> map = instr->hydrogen()->types()->at(i); |
3149 Label check_passed; | 3149 Label check_passed; |
3150 __ CompareMap( | 3150 __ CompareMap(object_map, map, &check_passed); |
3151 object_map, map, &check_passed, ALLOW_ELEMENT_TRANSITION_MAPS); | |
3152 if (last && !need_generic) { | 3151 if (last && !need_generic) { |
3153 DeoptimizeIf(ne, instr->environment()); | 3152 DeoptimizeIf(ne, instr->environment()); |
3154 __ bind(&check_passed); | 3153 __ bind(&check_passed); |
3155 EmitLoadFieldOrConstantFunction( | 3154 EmitLoadFieldOrConstantFunction( |
3156 result, object, map, name, instr->environment()); | 3155 result, object, map, name, instr->environment()); |
3157 } else { | 3156 } else { |
3158 Label next; | 3157 Label next; |
3159 __ b(ne, &next); | 3158 __ b(ne, &next); |
3160 __ bind(&check_passed); | 3159 __ bind(&check_passed); |
3161 EmitLoadFieldOrConstantFunction( | 3160 EmitLoadFieldOrConstantFunction( |
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5261 __ cmp(reg, ip); | 5260 __ cmp(reg, ip); |
5262 } else { | 5261 } else { |
5263 __ cmp(reg, Operand(target)); | 5262 __ cmp(reg, Operand(target)); |
5264 } | 5263 } |
5265 DeoptimizeIf(ne, instr->environment()); | 5264 DeoptimizeIf(ne, instr->environment()); |
5266 } | 5265 } |
5267 | 5266 |
5268 | 5267 |
5269 void LCodeGen::DoCheckMapCommon(Register map_reg, | 5268 void LCodeGen::DoCheckMapCommon(Register map_reg, |
5270 Handle<Map> map, | 5269 Handle<Map> map, |
5271 CompareMapMode mode, | |
5272 LEnvironment* env) { | 5270 LEnvironment* env) { |
5273 Label success; | 5271 Label success; |
5274 __ CompareMap(map_reg, map, &success, mode); | 5272 __ CompareMap(map_reg, map, &success); |
5275 DeoptimizeIf(ne, env); | 5273 DeoptimizeIf(ne, env); |
5276 __ bind(&success); | 5274 __ bind(&success); |
5277 } | 5275 } |
5278 | 5276 |
5279 | 5277 |
5280 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 5278 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
5281 Register map_reg = scratch0(); | 5279 Register map_reg = scratch0(); |
5282 LOperand* input = instr->value(); | 5280 LOperand* input = instr->value(); |
5283 ASSERT(input->IsRegister()); | 5281 ASSERT(input->IsRegister()); |
5284 Register reg = ToRegister(input); | 5282 Register reg = ToRegister(input); |
5285 | 5283 |
5286 Label success; | 5284 Label success; |
5287 SmallMapList* map_set = instr->hydrogen()->map_set(); | 5285 SmallMapList* map_set = instr->hydrogen()->map_set(); |
5288 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); | 5286 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
5289 for (int i = 0; i < map_set->length() - 1; i++) { | 5287 for (int i = 0; i < map_set->length() - 1; i++) { |
5290 Handle<Map> map = map_set->at(i); | 5288 Handle<Map> map = map_set->at(i); |
5291 __ CompareMap(map_reg, map, &success, REQUIRE_EXACT_MAP); | 5289 __ CompareMap(map_reg, map, &success); |
5292 __ b(eq, &success); | 5290 __ b(eq, &success); |
5293 } | 5291 } |
5294 Handle<Map> map = map_set->last(); | 5292 Handle<Map> map = map_set->last(); |
5295 DoCheckMapCommon(map_reg, map, REQUIRE_EXACT_MAP, instr->environment()); | 5293 DoCheckMapCommon(map_reg, map, instr->environment()); |
5296 __ bind(&success); | 5294 __ bind(&success); |
5297 } | 5295 } |
5298 | 5296 |
5299 | 5297 |
5300 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 5298 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
5301 DwVfpRegister value_reg = ToDoubleRegister(instr->unclamped()); | 5299 DwVfpRegister value_reg = ToDoubleRegister(instr->unclamped()); |
5302 Register result_reg = ToRegister(instr->result()); | 5300 Register result_reg = ToRegister(instr->result()); |
5303 DwVfpRegister temp_reg = ToDoubleRegister(instr->temp()); | 5301 DwVfpRegister temp_reg = ToDoubleRegister(instr->temp()); |
5304 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); | 5302 __ ClampDoubleToUint8(result_reg, value_reg, temp_reg); |
5305 } | 5303 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5359 ASSERT(prototypes->length() == maps->length()); | 5357 ASSERT(prototypes->length() == maps->length()); |
5360 | 5358 |
5361 if (instr->hydrogen()->CanOmitPrototypeChecks()) { | 5359 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
5362 for (int i = 0; i < maps->length(); i++) { | 5360 for (int i = 0; i < maps->length(); i++) { |
5363 prototype_maps_.Add(maps->at(i), info()->zone()); | 5361 prototype_maps_.Add(maps->at(i), info()->zone()); |
5364 } | 5362 } |
5365 } else { | 5363 } else { |
5366 for (int i = 0; i < prototypes->length(); i++) { | 5364 for (int i = 0; i < prototypes->length(); i++) { |
5367 __ LoadHeapObject(prototype_reg, prototypes->at(i)); | 5365 __ LoadHeapObject(prototype_reg, prototypes->at(i)); |
5368 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); | 5366 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
5369 DoCheckMapCommon(map_reg, | 5367 DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); |
5370 maps->at(i), | |
5371 ALLOW_ELEMENT_TRANSITION_MAPS, | |
5372 instr->environment()); | |
5373 } | 5368 } |
5374 } | 5369 } |
5375 } | 5370 } |
5376 | 5371 |
5377 | 5372 |
5378 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 5373 void LCodeGen::DoAllocateObject(LAllocateObject* instr) { |
5379 class DeferredAllocateObject: public LDeferredCode { | 5374 class DeferredAllocateObject: public LDeferredCode { |
5380 public: | 5375 public: |
5381 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 5376 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
5382 : LDeferredCode(codegen), instr_(instr) { } | 5377 : LDeferredCode(codegen), instr_(instr) { } |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6042 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6037 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
6043 __ ldr(result, FieldMemOperand(scratch, | 6038 __ ldr(result, FieldMemOperand(scratch, |
6044 FixedArray::kHeaderSize - kPointerSize)); | 6039 FixedArray::kHeaderSize - kPointerSize)); |
6045 __ bind(&done); | 6040 __ bind(&done); |
6046 } | 6041 } |
6047 | 6042 |
6048 | 6043 |
6049 #undef __ | 6044 #undef __ |
6050 | 6045 |
6051 } } // namespace v8::internal | 6046 } } // namespace v8::internal |
OLD | NEW |