OLD | NEW |
---|---|
1 // Copyright 2011 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 |
(...skipping 2546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2557 DeoptimizeIf(eq, instr->environment()); | 2557 DeoptimizeIf(eq, instr->environment()); |
2558 } | 2558 } |
2559 | 2559 |
2560 | 2560 |
2561 void LCodeGen::DoLoadKeyedSpecializedArrayElement( | 2561 void LCodeGen::DoLoadKeyedSpecializedArrayElement( |
2562 LLoadKeyedSpecializedArrayElement* instr) { | 2562 LLoadKeyedSpecializedArrayElement* instr) { |
2563 Register external_pointer = ToRegister(instr->external_pointer()); | 2563 Register external_pointer = ToRegister(instr->external_pointer()); |
2564 Register key = ToRegister(instr->key()); | 2564 Register key = ToRegister(instr->key()); |
2565 ExternalArrayType array_type = instr->array_type(); | 2565 ExternalArrayType array_type = instr->array_type(); |
2566 if (array_type == kExternalFloatArray) { | 2566 if (array_type == kExternalFloatArray) { |
2567 if (CpuFeatures::IsSupported(VFP3)) { | 2567 CpuFeatures::Scope scope(VFP3); |
2568 CpuFeatures::Scope scope(VFP3); | 2568 DwVfpRegister result(ToDoubleRegister(instr->result())); |
2569 DwVfpRegister result(ToDoubleRegister(instr->result())); | 2569 __ add(scratch0(), external_pointer, Operand(key, LSL, 2)); |
2570 __ add(scratch0(), external_pointer, Operand(key, LSL, 2)); | 2570 __ vldr(result.low(), scratch0(), 0); |
2571 __ vldr(result, scratch0(), 0); | 2571 __ vcvt_f64_f32(result, result.low()); |
2572 } else { | |
2573 Register result(ToRegister(instr->result())); | |
2574 __ ldr(result, MemOperand(external_pointer, key, LSL, 2)); | |
2575 } | |
2576 } else { | 2572 } else { |
2577 Register result(ToRegister(instr->result())); | 2573 Register result(ToRegister(instr->result())); |
2578 switch (array_type) { | 2574 switch (array_type) { |
2579 case kExternalByteArray: | 2575 case kExternalByteArray: |
2580 __ ldrsb(result, MemOperand(external_pointer, key)); | 2576 __ ldrsb(result, MemOperand(external_pointer, key)); |
2581 break; | 2577 break; |
2582 case kExternalUnsignedByteArray: | 2578 case kExternalUnsignedByteArray: |
2583 case kExternalPixelArray: | 2579 case kExternalPixelArray: |
2584 __ ldrb(result, MemOperand(external_pointer, key)); | 2580 __ ldrb(result, MemOperand(external_pointer, key)); |
2585 break; | 2581 break; |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3265 } | 3261 } |
3266 | 3262 |
3267 | 3263 |
3268 void LCodeGen::DoStoreKeyedSpecializedArrayElement( | 3264 void LCodeGen::DoStoreKeyedSpecializedArrayElement( |
3269 LStoreKeyedSpecializedArrayElement* instr) { | 3265 LStoreKeyedSpecializedArrayElement* instr) { |
3270 | 3266 |
3271 Register external_pointer = ToRegister(instr->external_pointer()); | 3267 Register external_pointer = ToRegister(instr->external_pointer()); |
3272 Register key = ToRegister(instr->key()); | 3268 Register key = ToRegister(instr->key()); |
3273 ExternalArrayType array_type = instr->array_type(); | 3269 ExternalArrayType array_type = instr->array_type(); |
3274 if (array_type == kExternalFloatArray) { | 3270 if (array_type == kExternalFloatArray) { |
3275 if (CpuFeatures::IsSupported(VFP3)) { | 3271 CpuFeatures::Scope scope(VFP3); |
3276 CpuFeatures::Scope scope(VFP3); | 3272 DwVfpRegister value(ToDoubleRegister(instr->value())); |
3277 DwVfpRegister value(ToDoubleRegister(instr->value())); | 3273 __ add(scratch0(), external_pointer, Operand(key, LSL, 2)); |
3278 __ add(scratch0(), external_pointer, Operand(key, LSL, 2)); | 3274 __ vcvt_f32_f64(value.low(), value); |
3279 __ vstr(value, scratch0(), 0); | 3275 __ vstr(value.low(), scratch0(), 0); |
danno
2011/04/12 15:10:50
You need a corresponding UseTempRegister since you
Jakob Kummerow
2011/04/12 15:13:39
Done.
| |
3280 } else { | |
3281 Register value(ToRegister(instr->value())); | |
3282 __ str(value, MemOperand(external_pointer, key, LSL, 2)); | |
3283 } | |
3284 } else { | 3276 } else { |
3285 Register value(ToRegister(instr->value())); | 3277 Register value(ToRegister(instr->value())); |
3286 switch (array_type) { | 3278 switch (array_type) { |
3287 case kExternalPixelArray: | 3279 case kExternalPixelArray: |
3288 // Clamp the value to [0..255]. | 3280 // Clamp the value to [0..255]. |
3289 __ Usat(value, 8, Operand(value)); | 3281 __ Usat(value, 8, Operand(value)); |
3290 __ strb(value, MemOperand(external_pointer, key)); | 3282 __ strb(value, MemOperand(external_pointer, key)); |
3291 break; | 3283 break; |
3292 case kExternalByteArray: | 3284 case kExternalByteArray: |
3293 case kExternalUnsignedByteArray: | 3285 case kExternalUnsignedByteArray: |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4296 ASSERT(!environment->HasBeenRegistered()); | 4288 ASSERT(!environment->HasBeenRegistered()); |
4297 RegisterEnvironmentForDeoptimization(environment); | 4289 RegisterEnvironmentForDeoptimization(environment); |
4298 ASSERT(osr_pc_offset_ == -1); | 4290 ASSERT(osr_pc_offset_ == -1); |
4299 osr_pc_offset_ = masm()->pc_offset(); | 4291 osr_pc_offset_ = masm()->pc_offset(); |
4300 } | 4292 } |
4301 | 4293 |
4302 | 4294 |
4303 #undef __ | 4295 #undef __ |
4304 | 4296 |
4305 } } // namespace v8::internal | 4297 } } // namespace v8::internal |
OLD | NEW |