OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/arm64/simulator-arm64.h" | 9 #include "src/arm64/simulator-arm64.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 __ Assert(eq, kExternalStringExpectedButNotFound); | 478 __ Assert(eq, kExternalStringExpectedButNotFound); |
479 } | 479 } |
480 // Rule out short external strings. | 480 // Rule out short external strings. |
481 STATIC_ASSERT(kShortExternalStringTag != 0); | 481 STATIC_ASSERT(kShortExternalStringTag != 0); |
482 // TestAndBranchIfAnySet can emit Tbnz. Do not use it because call_runtime | 482 // TestAndBranchIfAnySet can emit Tbnz. Do not use it because call_runtime |
483 // can be bound far away in deferred code. | 483 // can be bound far away in deferred code. |
484 __ Tst(result, kShortExternalStringMask); | 484 __ Tst(result, kShortExternalStringMask); |
485 __ B(ne, call_runtime); | 485 __ B(ne, call_runtime); |
486 __ Ldr(string, FieldMemOperand(string, ExternalString::kResourceDataOffset)); | 486 __ Ldr(string, FieldMemOperand(string, ExternalString::kResourceDataOffset)); |
487 | 487 |
488 Label ascii, done; | 488 Label one_byte, done; |
489 __ Bind(&check_encoding); | 489 __ Bind(&check_encoding); |
490 STATIC_ASSERT(kTwoByteStringTag == 0); | 490 STATIC_ASSERT(kTwoByteStringTag == 0); |
491 __ TestAndBranchIfAnySet(result, kStringEncodingMask, &ascii); | 491 __ TestAndBranchIfAnySet(result, kStringEncodingMask, &one_byte); |
492 // Two-byte string. | 492 // Two-byte string. |
493 __ Ldrh(result, MemOperand(string, index, SXTW, 1)); | 493 __ Ldrh(result, MemOperand(string, index, SXTW, 1)); |
494 __ B(&done); | 494 __ B(&done); |
495 __ Bind(&ascii); | 495 __ Bind(&one_byte); |
496 // Ascii string. | 496 // One-byte string. |
497 __ Ldrb(result, MemOperand(string, index, SXTW)); | 497 __ Ldrb(result, MemOperand(string, index, SXTW)); |
498 __ Bind(&done); | 498 __ Bind(&done); |
499 } | 499 } |
500 | 500 |
501 | 501 |
502 static MemOperand ExpConstant(Register base, int index) { | 502 static MemOperand ExpConstant(Register base, int index) { |
503 return MemOperand(base, index * kDoubleSize); | 503 return MemOperand(base, index * kDoubleSize); |
504 } | 504 } |
505 | 505 |
506 | 506 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 __ Fmul(result, double_temp3, double_temp1); | 617 __ Fmul(result, double_temp3, double_temp1); |
618 | 618 |
619 __ Bind(&done); | 619 __ Bind(&done); |
620 } | 620 } |
621 | 621 |
622 #undef __ | 622 #undef __ |
623 | 623 |
624 } } // namespace v8::internal | 624 } } // namespace v8::internal |
625 | 625 |
626 #endif // V8_TARGET_ARCH_ARM64 | 626 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |