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 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 } | 1315 } |
1316 | 1316 |
1317 | 1317 |
1318 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { | 1318 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
1319 Register result = ToRegister(instr->result()); | 1319 Register result = ToRegister(instr->result()); |
1320 Register array = ToRegister(instr->InputAt(0)); | 1320 Register array = ToRegister(instr->InputAt(0)); |
1321 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); | 1321 __ ldr(result, FieldMemOperand(array, JSArray::kLengthOffset)); |
1322 } | 1322 } |
1323 | 1323 |
1324 | 1324 |
| 1325 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) { |
| 1326 Register result = ToRegister(instr->result()); |
| 1327 Register array = ToRegister(instr->InputAt(0)); |
| 1328 __ ldr(result, FieldMemOperand(array, PixelArray::kLengthOffset)); |
| 1329 } |
| 1330 |
| 1331 |
1325 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { | 1332 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { |
1326 Register result = ToRegister(instr->result()); | 1333 Register result = ToRegister(instr->result()); |
1327 Register array = ToRegister(instr->InputAt(0)); | 1334 Register array = ToRegister(instr->InputAt(0)); |
1328 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset)); | 1335 __ ldr(result, FieldMemOperand(array, FixedArray::kLengthOffset)); |
1329 } | 1336 } |
1330 | 1337 |
1331 | 1338 |
1332 void LCodeGen::DoValueOf(LValueOf* instr) { | 1339 void LCodeGen::DoValueOf(LValueOf* instr) { |
1333 Register input = ToRegister(instr->InputAt(0)); | 1340 Register input = ToRegister(instr->InputAt(0)); |
1334 Register result = ToRegister(instr->result()); | 1341 Register result = ToRegister(instr->result()); |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2335 // in initial map. | 2342 // in initial map. |
2336 __ bind(&non_instance); | 2343 __ bind(&non_instance); |
2337 __ ldr(result, FieldMemOperand(result, Map::kConstructorOffset)); | 2344 __ ldr(result, FieldMemOperand(result, Map::kConstructorOffset)); |
2338 | 2345 |
2339 // All done. | 2346 // All done. |
2340 __ bind(&done); | 2347 __ bind(&done); |
2341 } | 2348 } |
2342 | 2349 |
2343 | 2350 |
2344 void LCodeGen::DoLoadElements(LLoadElements* instr) { | 2351 void LCodeGen::DoLoadElements(LLoadElements* instr) { |
2345 ASSERT(instr->result()->Equals(instr->InputAt(0))); | 2352 Register result = ToRegister(instr->result()); |
2346 Register reg = ToRegister(instr->InputAt(0)); | 2353 Register input = ToRegister(instr->InputAt(0)); |
2347 Register scratch = scratch0(); | 2354 Register scratch = scratch0(); |
2348 | 2355 |
2349 __ ldr(reg, FieldMemOperand(reg, JSObject::kElementsOffset)); | 2356 __ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset)); |
2350 if (FLAG_debug_code) { | 2357 if (FLAG_debug_code) { |
2351 Label done; | 2358 Label done; |
2352 __ ldr(scratch, FieldMemOperand(reg, HeapObject::kMapOffset)); | 2359 __ ldr(scratch, FieldMemOperand(result, HeapObject::kMapOffset)); |
2353 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); | 2360 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); |
2354 __ cmp(scratch, ip); | 2361 __ cmp(scratch, ip); |
2355 __ b(eq, &done); | 2362 __ b(eq, &done); |
| 2363 __ LoadRoot(ip, Heap::kPixelArrayMapRootIndex); |
| 2364 __ cmp(scratch, ip); |
| 2365 __ b(eq, &done); |
2356 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); | 2366 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); |
2357 __ cmp(scratch, ip); | 2367 __ cmp(scratch, ip); |
2358 __ Check(eq, "Check for fast elements failed."); | 2368 __ Check(eq, "Check for fast elements failed."); |
2359 __ bind(&done); | 2369 __ bind(&done); |
2360 } | 2370 } |
2361 } | 2371 } |
2362 | 2372 |
2363 | 2373 |
| 2374 void LCodeGen::DoLoadPixelArrayExternalPointer( |
| 2375 LLoadPixelArrayExternalPointer* instr) { |
| 2376 Register to_reg = ToRegister(instr->result()); |
| 2377 Register from_reg = ToRegister(instr->InputAt(0)); |
| 2378 __ ldr(to_reg, FieldMemOperand(from_reg, PixelArray::kExternalPointerOffset)); |
| 2379 } |
| 2380 |
| 2381 |
2364 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 2382 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
2365 Register arguments = ToRegister(instr->arguments()); | 2383 Register arguments = ToRegister(instr->arguments()); |
2366 Register length = ToRegister(instr->length()); | 2384 Register length = ToRegister(instr->length()); |
2367 Register index = ToRegister(instr->index()); | 2385 Register index = ToRegister(instr->index()); |
2368 Register result = ToRegister(instr->result()); | 2386 Register result = ToRegister(instr->result()); |
2369 | 2387 |
2370 // Bailout index is not a valid argument index. Use unsigned check to get | 2388 // Bailout index is not a valid argument index. Use unsigned check to get |
2371 // negative check for free. | 2389 // negative check for free. |
2372 __ sub(length, length, index, SetCC); | 2390 __ sub(length, length, index, SetCC); |
2373 DeoptimizeIf(ls, instr->environment()); | 2391 DeoptimizeIf(ls, instr->environment()); |
(...skipping 16 matching lines...) Expand all Loading... |
2390 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); | 2408 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); |
2391 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize)); | 2409 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize)); |
2392 | 2410 |
2393 // Check for the hole value. | 2411 // Check for the hole value. |
2394 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 2412 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
2395 __ cmp(result, scratch); | 2413 __ cmp(result, scratch); |
2396 DeoptimizeIf(eq, instr->environment()); | 2414 DeoptimizeIf(eq, instr->environment()); |
2397 } | 2415 } |
2398 | 2416 |
2399 | 2417 |
| 2418 void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) { |
| 2419 Register external_elements = ToRegister(instr->external_pointer()); |
| 2420 Register key = ToRegister(instr->key()); |
| 2421 Register result = ToRegister(instr->result()); |
| 2422 |
| 2423 // Load the result. |
| 2424 __ ldrb(result, MemOperand(external_elements, key)); |
| 2425 } |
| 2426 |
| 2427 |
2400 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 2428 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
2401 ASSERT(ToRegister(instr->object()).is(r1)); | 2429 ASSERT(ToRegister(instr->object()).is(r1)); |
2402 ASSERT(ToRegister(instr->key()).is(r0)); | 2430 ASSERT(ToRegister(instr->key()).is(r0)); |
2403 | 2431 |
2404 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); | 2432 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); |
2405 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2433 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2406 } | 2434 } |
2407 | 2435 |
2408 | 2436 |
2409 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2437 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3819 | 3847 |
3820 | 3848 |
3821 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 3849 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
3822 Abort("DoOsrEntry unimplemented."); | 3850 Abort("DoOsrEntry unimplemented."); |
3823 } | 3851 } |
3824 | 3852 |
3825 | 3853 |
3826 #undef __ | 3854 #undef __ |
3827 | 3855 |
3828 } } // namespace v8::internal | 3856 } } // namespace v8::internal |
OLD | NEW |