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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, | 1376 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, |
1377 not_seq_nor_cons /* 5 */, not_long_external /* 7 */; | 1377 not_seq_nor_cons /* 5 */, not_long_external /* 7 */; |
1378 | 1378 |
1379 __ bind(&check_underlying); | 1379 __ bind(&check_underlying); |
1380 __ LoadP(r2, FieldMemOperand(subject, HeapObject::kMapOffset)); | 1380 __ LoadP(r2, FieldMemOperand(subject, HeapObject::kMapOffset)); |
1381 __ LoadlB(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); | 1381 __ LoadlB(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); |
1382 | 1382 |
1383 // (1) Sequential string? If yes, go to (4). | 1383 // (1) Sequential string? If yes, go to (4). |
1384 | 1384 |
1385 STATIC_ASSERT((kIsNotStringMask | kStringRepresentationMask | | 1385 STATIC_ASSERT((kIsNotStringMask | kStringRepresentationMask | |
1386 kShortExternalStringMask) == 0x93); | 1386 kShortExternalStringMask) == 0xa7); |
1387 __ mov(r3, Operand(kIsNotStringMask | kStringRepresentationMask | | 1387 __ mov(r3, Operand(kIsNotStringMask | kStringRepresentationMask | |
1388 kShortExternalStringMask)); | 1388 kShortExternalStringMask)); |
1389 __ AndP(r3, r2); | 1389 __ AndP(r3, r2); |
1390 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); | 1390 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); |
1391 __ beq(&seq_string, Label::kNear); // Go to (4). | 1391 __ beq(&seq_string, Label::kNear); // Go to (4). |
1392 | 1392 |
1393 // (2) Sequential or cons? If not, go to (5). | 1393 // (2) Sequential or cons? If not, go to (5). |
1394 STATIC_ASSERT(kConsStringTag < kExternalStringTag); | 1394 STATIC_ASSERT(kConsStringTag < kExternalStringTag); |
1395 STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); | 1395 STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); |
1396 STATIC_ASSERT(kThinStringTag > kExternalStringTag); | 1396 STATIC_ASSERT(kThinStringTag > kExternalStringTag); |
(...skipping 18 matching lines...) Expand all Loading... |
1415 // Load previous index and check range before r5 is overwritten. We have to | 1415 // Load previous index and check range before r5 is overwritten. We have to |
1416 // use r5 instead of subject here because subject might have been only made | 1416 // use r5 instead of subject here because subject might have been only made |
1417 // to look like a sequential string when it actually is an external string. | 1417 // to look like a sequential string when it actually is an external string. |
1418 __ LoadP(r3, MemOperand(sp, kPreviousIndexOffset)); | 1418 __ LoadP(r3, MemOperand(sp, kPreviousIndexOffset)); |
1419 __ JumpIfNotSmi(r3, &runtime); | 1419 __ JumpIfNotSmi(r3, &runtime); |
1420 __ LoadP(r5, FieldMemOperand(r5, String::kLengthOffset)); | 1420 __ LoadP(r5, FieldMemOperand(r5, String::kLengthOffset)); |
1421 __ CmpLogicalP(r5, r3); | 1421 __ CmpLogicalP(r5, r3); |
1422 __ ble(&runtime); | 1422 __ ble(&runtime); |
1423 __ SmiUntag(r3); | 1423 __ SmiUntag(r3); |
1424 | 1424 |
1425 STATIC_ASSERT(4 == kOneByteStringTag); | 1425 STATIC_ASSERT(8 == kOneByteStringTag); |
1426 STATIC_ASSERT(kTwoByteStringTag == 0); | 1426 STATIC_ASSERT(kTwoByteStringTag == 0); |
1427 STATIC_ASSERT(kStringEncodingMask == 4); | 1427 STATIC_ASSERT(kStringEncodingMask == 8); |
1428 __ ExtractBitMask(r5, r2, kStringEncodingMask, SetRC); | 1428 __ ExtractBitMask(r5, r2, kStringEncodingMask, SetRC); |
1429 __ beq(&encoding_type_UC16, Label::kNear); | 1429 __ beq(&encoding_type_UC16, Label::kNear); |
1430 __ LoadP(code, | 1430 __ LoadP(code, |
1431 FieldMemOperand(regexp_data, JSRegExp::kDataOneByteCodeOffset)); | 1431 FieldMemOperand(regexp_data, JSRegExp::kDataOneByteCodeOffset)); |
1432 __ b(&br_over, Label::kNear); | 1432 __ b(&br_over, Label::kNear); |
1433 __ bind(&encoding_type_UC16); | 1433 __ bind(&encoding_type_UC16); |
1434 __ LoadP(code, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset)); | 1434 __ LoadP(code, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset)); |
1435 __ bind(&br_over); | 1435 __ bind(&br_over); |
1436 | 1436 |
1437 // (E) Carry on. String handling is done. | 1437 // (E) Carry on. String handling is done. |
(...skipping 2921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4359 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 4359 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
4360 kStackUnwindSpace, NULL, return_value_operand, NULL); | 4360 kStackUnwindSpace, NULL, return_value_operand, NULL); |
4361 } | 4361 } |
4362 | 4362 |
4363 #undef __ | 4363 #undef __ |
4364 | 4364 |
4365 } // namespace internal | 4365 } // namespace internal |
4366 } // namespace v8 | 4366 } // namespace v8 |
4367 | 4367 |
4368 #endif // V8_TARGET_ARCH_S390 | 4368 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |