| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 Register map = r8; | 1367 Register map = r8; |
| 1368 Register index = r4; | 1368 Register index = r4; |
| 1369 __ LoadP(map, | 1369 __ LoadP(map, |
| 1370 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1370 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
| 1371 __ LoadP(map, | 1371 __ LoadP(map, |
| 1372 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); | 1372 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); |
| 1373 __ LoadP(index, FieldMemOperand(map, FixedArray::kLengthOffset)); | 1373 __ LoadP(index, FieldMemOperand(map, FixedArray::kLengthOffset)); |
| 1374 __ CmpSmiLiteral(index, Smi::FromInt(2), r0); | 1374 __ CmpSmiLiteral(index, Smi::FromInt(2), r0); |
| 1375 __ blt(&gotta_call_runtime); | 1375 __ blt(&gotta_call_runtime); |
| 1376 | 1376 |
| 1377 // Find literals. | |
| 1378 // r9 : native context | 1377 // r9 : native context |
| 1379 // r4 : length / index | 1378 // r4 : length / index |
| 1380 // r8 : optimized code map | 1379 // r8 : optimized code map |
| 1381 // r5 : new target | 1380 // r5 : new target |
| 1382 // r3 : closure | 1381 // r3 : closure |
| 1383 Register native_context = r9; | 1382 Register native_context = r9; |
| 1384 __ LoadP(native_context, NativeContextMemOperand()); | 1383 __ LoadP(native_context, NativeContextMemOperand()); |
| 1385 | 1384 |
| 1386 __ bind(&loop_top); | 1385 __ bind(&loop_top); |
| 1387 Register temp = r1; | 1386 Register temp = r1; |
| 1388 Register array_pointer = r7; | 1387 Register array_pointer = r7; |
| 1389 | 1388 |
| 1390 // Does the native context match? | 1389 // Does the native context match? |
| 1391 __ SmiToPtrArrayOffset(array_pointer, index); | 1390 __ SmiToPtrArrayOffset(array_pointer, index); |
| 1392 __ AddP(array_pointer, map, array_pointer); | 1391 __ AddP(array_pointer, map, array_pointer); |
| 1393 __ LoadP(temp, FieldMemOperand(array_pointer, | 1392 __ LoadP(temp, FieldMemOperand(array_pointer, |
| 1394 SharedFunctionInfo::kOffsetToPreviousContext)); | 1393 SharedFunctionInfo::kOffsetToPreviousContext)); |
| 1395 __ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | 1394 __ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
| 1396 __ CmpP(temp, native_context); | 1395 __ CmpP(temp, native_context); |
| 1397 __ bne(&loop_bottom, Label::kNear); | 1396 __ bne(&loop_bottom, Label::kNear); |
| 1398 // Literals available? | |
| 1399 __ LoadP(temp, | |
| 1400 FieldMemOperand(array_pointer, | |
| 1401 SharedFunctionInfo::kOffsetToPreviousLiterals)); | |
| 1402 __ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | |
| 1403 __ JumpIfSmi(temp, &gotta_call_runtime); | |
| 1404 | |
| 1405 // Save the literals in the closure. | |
| 1406 __ StoreP(temp, FieldMemOperand(closure, JSFunction::kLiteralsOffset), r0); | |
| 1407 __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, r6, | |
| 1408 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | |
| 1409 OMIT_SMI_CHECK); | |
| 1410 | 1397 |
| 1411 // Code available? | 1398 // Code available? |
| 1412 Register entry = r6; | 1399 Register entry = r6; |
| 1413 __ LoadP(entry, | 1400 __ LoadP(entry, |
| 1414 FieldMemOperand(array_pointer, | 1401 FieldMemOperand(array_pointer, |
| 1415 SharedFunctionInfo::kOffsetToPreviousCachedCode)); | 1402 SharedFunctionInfo::kOffsetToPreviousCachedCode)); |
| 1416 __ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); | 1403 __ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); |
| 1417 __ JumpIfSmi(entry, &try_shared); | 1404 __ JumpIfSmi(entry, &try_shared); |
| 1418 | 1405 |
| 1419 // Found literals and code. Get them into the closure and return. | 1406 // Found code. Get it into the closure and return. |
| 1420 // Store code entry in the closure. | 1407 // Store code entry in the closure. |
| 1421 __ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1408 __ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1422 __ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0); | 1409 __ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0); |
| 1423 __ RecordWriteCodeEntryField(closure, entry, r7); | 1410 __ RecordWriteCodeEntryField(closure, entry, r7); |
| 1424 | 1411 |
| 1425 // Link the closure into the optimized function list. | 1412 // Link the closure into the optimized function list. |
| 1426 // r6 : code entry | 1413 // r6 : code entry |
| 1427 // r9: native context | 1414 // r9: native context |
| 1428 // r3 : closure | 1415 // r3 : closure |
| 1429 __ LoadP( | 1416 __ LoadP( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1443 __ RecordWriteContextSlot(native_context, function_list_offset, r7, temp, | 1430 __ RecordWriteContextSlot(native_context, function_list_offset, r7, temp, |
| 1444 kLRHasNotBeenSaved, kDontSaveFPRegs); | 1431 kLRHasNotBeenSaved, kDontSaveFPRegs); |
| 1445 __ JumpToJSEntry(entry); | 1432 __ JumpToJSEntry(entry); |
| 1446 | 1433 |
| 1447 __ bind(&loop_bottom); | 1434 __ bind(&loop_bottom); |
| 1448 __ SubSmiLiteral(index, index, Smi::FromInt(SharedFunctionInfo::kEntryLength), | 1435 __ SubSmiLiteral(index, index, Smi::FromInt(SharedFunctionInfo::kEntryLength), |
| 1449 r0); | 1436 r0); |
| 1450 __ CmpSmiLiteral(index, Smi::FromInt(1), r0); | 1437 __ CmpSmiLiteral(index, Smi::FromInt(1), r0); |
| 1451 __ bgt(&loop_top); | 1438 __ bgt(&loop_top); |
| 1452 | 1439 |
| 1453 // We found neither literals nor code. | 1440 // We found no code. |
| 1454 __ b(&gotta_call_runtime); | 1441 __ b(&gotta_call_runtime); |
| 1455 | 1442 |
| 1456 __ bind(&try_shared); | 1443 __ bind(&try_shared); |
| 1457 __ LoadP(entry, | 1444 __ LoadP(entry, |
| 1458 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1445 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
| 1459 // Is the shared function marked for tier up? | 1446 // Is the shared function marked for tier up? |
| 1460 __ LoadlB(temp, FieldMemOperand( | 1447 __ LoadlB(temp, FieldMemOperand( |
| 1461 entry, SharedFunctionInfo::kMarkedForTierUpByteOffset)); | 1448 entry, SharedFunctionInfo::kMarkedForTierUpByteOffset)); |
| 1462 __ TestBit(temp, SharedFunctionInfo::kMarkedForTierUpBitWithinByte, r0); | 1449 __ TestBit(temp, SharedFunctionInfo::kMarkedForTierUpBitWithinByte, r0); |
| 1463 __ bne(&gotta_call_runtime); | 1450 __ bne(&gotta_call_runtime); |
| (...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 __ bkpt(0); | 2971 __ bkpt(0); |
| 2985 } | 2972 } |
| 2986 } | 2973 } |
| 2987 | 2974 |
| 2988 #undef __ | 2975 #undef __ |
| 2989 | 2976 |
| 2990 } // namespace internal | 2977 } // namespace internal |
| 2991 } // namespace v8 | 2978 } // namespace v8 |
| 2992 | 2979 |
| 2993 #endif // V8_TARGET_ARCH_S390 | 2980 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |