OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 andl(scratch2, Immediate(kFlatAsciiStringMask)); | 1393 andl(scratch2, Immediate(kFlatAsciiStringMask)); |
1394 // Interleave the bits to check both scratch1 and scratch2 in one test. | 1394 // Interleave the bits to check both scratch1 and scratch2 in one test. |
1395 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); | 1395 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); |
1396 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); | 1396 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); |
1397 cmpl(scratch1, | 1397 cmpl(scratch1, |
1398 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3))); | 1398 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3))); |
1399 j(not_equal, on_fail); | 1399 j(not_equal, on_fail); |
1400 } | 1400 } |
1401 | 1401 |
1402 | 1402 |
| 1403 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii( |
| 1404 Register instance_type, |
| 1405 Register scratch, |
| 1406 Label *failure) { |
| 1407 if (!scratch.is(instance_type)) { |
| 1408 movl(scratch, instance_type); |
| 1409 } |
| 1410 |
| 1411 const int kFlatAsciiStringMask = |
| 1412 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; |
| 1413 |
| 1414 andl(scratch, Immediate(kFlatAsciiStringMask)); |
| 1415 cmpl(scratch, Immediate(kStringTag | kSeqStringTag | kAsciiStringTag)); |
| 1416 j(not_equal, failure); |
| 1417 } |
| 1418 |
| 1419 |
| 1420 void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialAscii( |
| 1421 Register first_object_instance_type, |
| 1422 Register second_object_instance_type, |
| 1423 Register scratch1, |
| 1424 Register scratch2, |
| 1425 Label* on_fail) { |
| 1426 // Load instance type for both strings. |
| 1427 movq(scratch1, first_object_instance_type); |
| 1428 movq(scratch2, second_object_instance_type); |
| 1429 |
| 1430 // Check that both are flat ascii strings. |
| 1431 ASSERT(kNotStringTag != 0); |
| 1432 const int kFlatAsciiStringMask = |
| 1433 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; |
| 1434 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; |
| 1435 |
| 1436 andl(scratch1, Immediate(kFlatAsciiStringMask)); |
| 1437 andl(scratch2, Immediate(kFlatAsciiStringMask)); |
| 1438 // Interleave the bits to check both scratch1 and scratch2 in one test. |
| 1439 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); |
| 1440 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); |
| 1441 cmpl(scratch1, |
| 1442 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3))); |
| 1443 j(not_equal, on_fail); |
| 1444 } |
| 1445 |
| 1446 |
1403 void MacroAssembler::Move(Register dst, Handle<Object> source) { | 1447 void MacroAssembler::Move(Register dst, Handle<Object> source) { |
1404 ASSERT(!source->IsFailure()); | 1448 ASSERT(!source->IsFailure()); |
1405 if (source->IsSmi()) { | 1449 if (source->IsSmi()) { |
1406 Move(dst, Smi::cast(*source)); | 1450 Move(dst, Smi::cast(*source)); |
1407 } else { | 1451 } else { |
1408 movq(dst, source, RelocInfo::EMBEDDED_OBJECT); | 1452 movq(dst, source, RelocInfo::EMBEDDED_OBJECT); |
1409 } | 1453 } |
1410 } | 1454 } |
1411 | 1455 |
1412 | 1456 |
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2584 CodePatcher::~CodePatcher() { | 2628 CodePatcher::~CodePatcher() { |
2585 // Indicate that code has changed. | 2629 // Indicate that code has changed. |
2586 CPU::FlushICache(address_, size_); | 2630 CPU::FlushICache(address_, size_); |
2587 | 2631 |
2588 // Check that the code was patched as expected. | 2632 // Check that the code was patched as expected. |
2589 ASSERT(masm_.pc_ == address_ + size_); | 2633 ASSERT(masm_.pc_ == address_ + size_); |
2590 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2634 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2591 } | 2635 } |
2592 | 2636 |
2593 } } // namespace v8::internal | 2637 } } // namespace v8::internal |
OLD | NEW |