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 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 } | 1329 } |
1330 | 1330 |
1331 | 1331 |
1332 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { | 1332 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
1333 Register result = ToRegister(instr->result()); | 1333 Register result = ToRegister(instr->result()); |
1334 Register array = ToRegister(instr->InputAt(0)); | 1334 Register array = ToRegister(instr->InputAt(0)); |
1335 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); | 1335 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); |
1336 } | 1336 } |
1337 | 1337 |
1338 | 1338 |
1339 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) { | 1339 void LCodeGen::DoExternalArrayLength(LExternalArrayLength* instr) { |
1340 Register result = ToRegister(instr->result()); | 1340 Register result = ToRegister(instr->result()); |
1341 Register array = ToRegister(instr->InputAt(0)); | 1341 Register array = ToRegister(instr->InputAt(0)); |
1342 __ ldr(result, FieldMemOperand(array, PixelArray::kLengthOffset)); | 1342 __ ldr(result, FieldMemOperand(array, ExternalArray::kLengthOffset)); |
1343 } | 1343 } |
1344 | 1344 |
1345 | 1345 |
1346 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { | 1346 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { |
1347 Register result = ToRegister(instr->result()); | 1347 Register result = ToRegister(instr->result()); |
1348 Register array = ToRegister(instr->InputAt(0)); | 1348 Register array = ToRegister(instr->InputAt(0)); |
1349 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset)); | 1349 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset)); |
1350 } | 1350 } |
1351 | 1351 |
1352 | 1352 |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2404 Register input = ToRegister(instr->InputAt(0)); | 2404 Register input = ToRegister(instr->InputAt(0)); |
2405 Register scratch = scratch0(); | 2405 Register scratch = scratch0(); |
2406 | 2406 |
2407 __ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset)); | 2407 __ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset)); |
2408 if (FLAG_debug_code) { | 2408 if (FLAG_debug_code) { |
2409 Label done; | 2409 Label done; |
2410 __ ldr(scratch, FieldMemOperand(result, HeapObject::kMapOffset)); | 2410 __ ldr(scratch, FieldMemOperand(result, HeapObject::kMapOffset)); |
2411 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); | 2411 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); |
2412 __ cmp(scratch, ip); | 2412 __ cmp(scratch, ip); |
2413 __ b(eq, &done); | 2413 __ b(eq, &done); |
2414 __ LoadRoot(ip, Heap::kPixelArrayMapRootIndex); | 2414 __ LoadRoot(ip, Heap::kExternalPixelArrayMapRootIndex); |
2415 __ cmp(scratch, ip); | 2415 __ cmp(scratch, ip); |
2416 __ b(eq, &done); | 2416 __ b(eq, &done); |
2417 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); | 2417 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); |
2418 __ cmp(scratch, ip); | 2418 __ cmp(scratch, ip); |
2419 __ Check(eq, "Check for fast elements failed."); | 2419 __ Check(eq, "Check for fast elements failed."); |
2420 __ bind(&done); | 2420 __ bind(&done); |
2421 } | 2421 } |
2422 } | 2422 } |
2423 | 2423 |
2424 | 2424 |
2425 void LCodeGen::DoLoadPixelArrayExternalPointer( | 2425 void LCodeGen::DoLoadExternalArrayPointer( |
2426 LLoadPixelArrayExternalPointer* instr) { | 2426 LLoadExternalArrayPointer* instr) { |
2427 Register to_reg = ToRegister(instr->result()); | 2427 Register to_reg = ToRegister(instr->result()); |
2428 Register from_reg = ToRegister(instr->InputAt(0)); | 2428 Register from_reg = ToRegister(instr->InputAt(0)); |
2429 __ ldr(to_reg, FieldMemOperand(from_reg, PixelArray::kExternalPointerOffset)); | 2429 __ ldr(to_reg, FieldMemOperand(from_reg, |
| 2430 ExternalArray::kExternalPointerOffset)); |
2430 } | 2431 } |
2431 | 2432 |
2432 | 2433 |
2433 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 2434 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
2434 Register arguments = ToRegister(instr->arguments()); | 2435 Register arguments = ToRegister(instr->arguments()); |
2435 Register length = ToRegister(instr->length()); | 2436 Register length = ToRegister(instr->length()); |
2436 Register index = ToRegister(instr->index()); | 2437 Register index = ToRegister(instr->index()); |
2437 Register result = ToRegister(instr->result()); | 2438 Register result = ToRegister(instr->result()); |
2438 | 2439 |
2439 // Bailout index is not a valid argument index. Use unsigned check to get | 2440 // Bailout index is not a valid argument index. Use unsigned check to get |
(...skipping 20 matching lines...) Expand all Loading... |
2460 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize)); | 2461 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize)); |
2461 | 2462 |
2462 // Check for the hole value. | 2463 // Check for the hole value. |
2463 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 2464 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
2464 __ cmp(result, scratch); | 2465 __ cmp(result, scratch); |
2465 DeoptimizeIf(eq, instr->environment()); | 2466 DeoptimizeIf(eq, instr->environment()); |
2466 } | 2467 } |
2467 | 2468 |
2468 | 2469 |
2469 void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) { | 2470 void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) { |
2470 Register external_elements = ToRegister(instr->external_pointer()); | 2471 Register external_pointer = ToRegister(instr->external_pointer()); |
2471 Register key = ToRegister(instr->key()); | 2472 Register key = ToRegister(instr->key()); |
2472 Register result = ToRegister(instr->result()); | 2473 Register result = ToRegister(instr->result()); |
2473 | 2474 |
2474 // Load the result. | 2475 // Load the result. |
2475 __ ldrb(result, MemOperand(external_elements, key)); | 2476 __ ldrb(result, MemOperand(external_pointer, key)); |
2476 } | 2477 } |
2477 | 2478 |
2478 | 2479 |
2479 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 2480 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
2480 ASSERT(ToRegister(instr->object()).is(r1)); | 2481 ASSERT(ToRegister(instr->object()).is(r1)); |
2481 ASSERT(ToRegister(instr->key()).is(r0)); | 2482 ASSERT(ToRegister(instr->key()).is(r0)); |
2482 | 2483 |
2483 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); | 2484 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); |
2484 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2485 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2485 } | 2486 } |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3015 } | 3016 } |
3016 | 3017 |
3017 if (instr->hydrogen()->NeedsWriteBarrier()) { | 3018 if (instr->hydrogen()->NeedsWriteBarrier()) { |
3018 // Compute address of modified element and store it into key register. | 3019 // Compute address of modified element and store it into key register. |
3019 __ add(key, scratch, Operand(FixedArray::kHeaderSize)); | 3020 __ add(key, scratch, Operand(FixedArray::kHeaderSize)); |
3020 __ RecordWrite(elements, key, value); | 3021 __ RecordWrite(elements, key, value); |
3021 } | 3022 } |
3022 } | 3023 } |
3023 | 3024 |
3024 | 3025 |
| 3026 void LCodeGen::DoStorePixelArrayElement(LStorePixelArrayElement* instr) { |
| 3027 Register external_pointer = ToRegister(instr->external_pointer()); |
| 3028 Register key = ToRegister(instr->key()); |
| 3029 Register value = ToRegister(instr->value()); |
| 3030 |
| 3031 // Clamp the value to [0..255]. |
| 3032 __ Usat(value, 8, Operand(value)); |
| 3033 __ strb(value, MemOperand(external_pointer, key, LSL, 0)); |
| 3034 } |
| 3035 |
| 3036 |
3025 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 3037 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
3026 ASSERT(ToRegister(instr->object()).is(r2)); | 3038 ASSERT(ToRegister(instr->object()).is(r2)); |
3027 ASSERT(ToRegister(instr->key()).is(r1)); | 3039 ASSERT(ToRegister(instr->key()).is(r1)); |
3028 ASSERT(ToRegister(instr->value()).is(r0)); | 3040 ASSERT(ToRegister(instr->value()).is(r0)); |
3029 | 3041 |
3030 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); | 3042 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); |
3031 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3043 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3032 } | 3044 } |
3033 | 3045 |
3034 | 3046 |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3967 ASSERT(!environment->HasBeenRegistered()); | 3979 ASSERT(!environment->HasBeenRegistered()); |
3968 RegisterEnvironmentForDeoptimization(environment); | 3980 RegisterEnvironmentForDeoptimization(environment); |
3969 ASSERT(osr_pc_offset_ == -1); | 3981 ASSERT(osr_pc_offset_ == -1); |
3970 osr_pc_offset_ = masm()->pc_offset(); | 3982 osr_pc_offset_ = masm()->pc_offset(); |
3971 } | 3983 } |
3972 | 3984 |
3973 | 3985 |
3974 #undef __ | 3986 #undef __ |
3975 | 3987 |
3976 } } // namespace v8::internal | 3988 } } // namespace v8::internal |
OLD | NEW |