Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: runtime/vm/intrinsifier_arm.cc

Issue 1304243008: Load predefined symbols address via Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1653 __ cmp(R1, Operand(R2)); 1653 __ cmp(R1, Operand(R2));
1654 __ b(&fall_through, CS); // Runtime throws exception. 1654 __ b(&fall_through, CS); // Runtime throws exception.
1655 1655
1656 __ CompareClassId(R0, kOneByteStringCid, R3); 1656 __ CompareClassId(R0, kOneByteStringCid, R3);
1657 __ b(&try_two_byte_string, NE); 1657 __ b(&try_two_byte_string, NE);
1658 __ SmiUntag(R1); 1658 __ SmiUntag(R1);
1659 __ AddImmediate(R0, OneByteString::data_offset() - kHeapObjectTag); 1659 __ AddImmediate(R0, OneByteString::data_offset() - kHeapObjectTag);
1660 __ ldrb(R1, Address(R0, R1)); 1660 __ ldrb(R1, Address(R0, R1));
1661 __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols); 1661 __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols);
1662 __ b(&fall_through, GE); 1662 __ b(&fall_through, GE);
1663 const ExternalLabel symbols_label( 1663 __ ldr(R0, Address(THR, Thread::predefined_symbols_address_offset()));
1664 reinterpret_cast<uword>(Symbols::PredefinedAddress()));
1665 __ Push(PP);
1666 __ LoadPoolPointer();
1667 assembler->set_constant_pool_allowed(true);
1668 __ LoadExternalLabel(R0, &symbols_label, kNotPatchable);
1669 assembler->set_constant_pool_allowed(false);
1670 __ Pop(PP);
1671 __ AddImmediate(R0, Symbols::kNullCharCodeSymbolOffset * kWordSize); 1664 __ AddImmediate(R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
1672 __ ldr(R0, Address(R0, R1, LSL, 2)); 1665 __ ldr(R0, Address(R0, R1, LSL, 2));
1673 __ Ret(); 1666 __ Ret();
1674 1667
1675 __ Bind(&try_two_byte_string); 1668 __ Bind(&try_two_byte_string);
1676 __ CompareClassId(R0, kTwoByteStringCid, R3); 1669 __ CompareClassId(R0, kTwoByteStringCid, R3);
1677 __ b(&fall_through, NE); 1670 __ b(&fall_through, NE);
1678 ASSERT(kSmiTagShift == 1); 1671 ASSERT(kSmiTagShift == 1);
1679 __ AddImmediate(R0, TwoByteString::data_offset() - kHeapObjectTag); 1672 __ AddImmediate(R0, TwoByteString::data_offset() - kHeapObjectTag);
1680 __ ldrh(R1, Address(R0, R1)); 1673 __ ldrh(R1, Address(R0, R1));
1681 __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols); 1674 __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols);
1682 __ b(&fall_through, GE); 1675 __ b(&fall_through, GE);
1683 __ Push(PP); 1676 __ ldr(R0, Address(THR, Thread::predefined_symbols_address_offset()));
1684 __ LoadPoolPointer();
1685 assembler->set_constant_pool_allowed(true);
1686 __ LoadExternalLabel(R0, &symbols_label, kNotPatchable);
1687 assembler->set_constant_pool_allowed(false);
1688 __ Pop(PP);
1689 __ AddImmediate(R0, Symbols::kNullCharCodeSymbolOffset * kWordSize); 1677 __ AddImmediate(R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
1690 __ ldr(R0, Address(R0, R1, LSL, 2)); 1678 __ ldr(R0, Address(R0, R1, LSL, 2));
1691 __ Ret(); 1679 __ Ret();
1692 1680
1693 __ Bind(&fall_through); 1681 __ Bind(&fall_through);
1694 } 1682 }
1695 1683
1696 1684
1697 void Intrinsifier::StringBaseIsEmpty(Assembler* assembler) { 1685 void Intrinsifier::StringBaseIsEmpty(Assembler* assembler) {
1698 __ ldr(R0, Address(SP, 0 * kWordSize)); 1686 __ ldr(R0, Address(SP, 0 * kWordSize));
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 2047
2060 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 2048 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
2061 __ LoadIsolate(R0); 2049 __ LoadIsolate(R0);
2062 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); 2050 __ ldr(R0, Address(R0, Isolate::current_tag_offset()));
2063 __ Ret(); 2051 __ Ret();
2064 } 2052 }
2065 2053
2066 } // namespace dart 2054 } // namespace dart
2067 2055
2068 #endif // defined TARGET_ARCH_ARM 2056 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698