| 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, | 1379 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, |
| 1380 not_seq_nor_cons /* 5 */, not_long_external /* 7 */; | 1380 not_seq_nor_cons /* 5 */, not_long_external /* 7 */; |
| 1381 | 1381 |
| 1382 __ bind(&check_underlying); | 1382 __ bind(&check_underlying); |
| 1383 __ LoadP(r3, FieldMemOperand(subject, HeapObject::kMapOffset)); | 1383 __ LoadP(r3, FieldMemOperand(subject, HeapObject::kMapOffset)); |
| 1384 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); | 1384 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); |
| 1385 | 1385 |
| 1386 // (1) Sequential string? If yes, go to (4). | 1386 // (1) Sequential string? If yes, go to (4). |
| 1387 | 1387 |
| 1388 STATIC_ASSERT((kIsNotStringMask | kStringRepresentationMask | | 1388 STATIC_ASSERT((kIsNotStringMask | kStringRepresentationMask | |
| 1389 kShortExternalStringMask) == 0x93); | 1389 kShortExternalStringMask) == 0xa7); |
| 1390 __ andi(r4, r3, Operand(kIsNotStringMask | kStringRepresentationMask | | 1390 __ andi(r4, r3, Operand(kIsNotStringMask | kStringRepresentationMask | |
| 1391 kShortExternalStringMask)); | 1391 kShortExternalStringMask)); |
| 1392 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); | 1392 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); |
| 1393 __ beq(&seq_string, cr0); // Go to (4). | 1393 __ beq(&seq_string, cr0); // Go to (4). |
| 1394 | 1394 |
| 1395 // (2) Sequential or cons? If not, go to (5). | 1395 // (2) Sequential or cons? If not, go to (5). |
| 1396 STATIC_ASSERT(kConsStringTag < kExternalStringTag); | 1396 STATIC_ASSERT(kConsStringTag < kExternalStringTag); |
| 1397 STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); | 1397 STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); |
| 1398 STATIC_ASSERT(kThinStringTag > kExternalStringTag); | 1398 STATIC_ASSERT(kThinStringTag > kExternalStringTag); |
| 1399 STATIC_ASSERT(kIsNotStringMask > kExternalStringTag); | 1399 STATIC_ASSERT(kIsNotStringMask > kExternalStringTag); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1417 // Load previous index and check range before r6 is overwritten. We have to | 1417 // Load previous index and check range before r6 is overwritten. We have to |
| 1418 // use r6 instead of subject here because subject might have been only made | 1418 // use r6 instead of subject here because subject might have been only made |
| 1419 // to look like a sequential string when it actually is an external string. | 1419 // to look like a sequential string when it actually is an external string. |
| 1420 __ LoadP(r4, MemOperand(sp, kPreviousIndexOffset)); | 1420 __ LoadP(r4, MemOperand(sp, kPreviousIndexOffset)); |
| 1421 __ JumpIfNotSmi(r4, &runtime); | 1421 __ JumpIfNotSmi(r4, &runtime); |
| 1422 __ LoadP(r6, FieldMemOperand(r6, String::kLengthOffset)); | 1422 __ LoadP(r6, FieldMemOperand(r6, String::kLengthOffset)); |
| 1423 __ cmpl(r6, r4); | 1423 __ cmpl(r6, r4); |
| 1424 __ ble(&runtime); | 1424 __ ble(&runtime); |
| 1425 __ SmiUntag(r4); | 1425 __ SmiUntag(r4); |
| 1426 | 1426 |
| 1427 STATIC_ASSERT(4 == kOneByteStringTag); | 1427 STATIC_ASSERT(8 == kOneByteStringTag); |
| 1428 STATIC_ASSERT(kTwoByteStringTag == 0); | 1428 STATIC_ASSERT(kTwoByteStringTag == 0); |
| 1429 STATIC_ASSERT(kStringEncodingMask == 4); | 1429 STATIC_ASSERT(kStringEncodingMask == 8); |
| 1430 __ ExtractBitMask(r6, r3, kStringEncodingMask, SetRC); | 1430 __ ExtractBitMask(r6, r3, kStringEncodingMask, SetRC); |
| 1431 __ beq(&encoding_type_UC16, cr0); | 1431 __ beq(&encoding_type_UC16, cr0); |
| 1432 __ LoadP(code, | 1432 __ LoadP(code, |
| 1433 FieldMemOperand(regexp_data, JSRegExp::kDataOneByteCodeOffset)); | 1433 FieldMemOperand(regexp_data, JSRegExp::kDataOneByteCodeOffset)); |
| 1434 __ b(&br_over); | 1434 __ b(&br_over); |
| 1435 __ bind(&encoding_type_UC16); | 1435 __ bind(&encoding_type_UC16); |
| 1436 __ LoadP(code, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset)); | 1436 __ LoadP(code, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset)); |
| 1437 __ bind(&br_over); | 1437 __ bind(&br_over); |
| 1438 | 1438 |
| 1439 // (E) Carry on. String handling is done. | 1439 // (E) Carry on. String handling is done. |
| (...skipping 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4430 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | 4430 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
| 4431 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 4431 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 4432 kStackUnwindSpace, NULL, return_value_operand, NULL); | 4432 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 4433 } | 4433 } |
| 4434 | 4434 |
| 4435 #undef __ | 4435 #undef __ |
| 4436 } // namespace internal | 4436 } // namespace internal |
| 4437 } // namespace v8 | 4437 } // namespace v8 |
| 4438 | 4438 |
| 4439 #endif // V8_TARGET_ARCH_PPC | 4439 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |