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

Side by Side Diff: runtime/vm/intrinsifier_x64.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/intrinsifier_mips.cc ('k') | runtime/vm/object.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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 // Range check. 1601 // Range check.
1602 __ cmpq(RCX, FieldAddress(RAX, String::length_offset())); 1602 __ cmpq(RCX, FieldAddress(RAX, String::length_offset()));
1603 // Runtime throws exception. 1603 // Runtime throws exception.
1604 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump); 1604 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
1605 __ CompareClassId(RAX, kOneByteStringCid); 1605 __ CompareClassId(RAX, kOneByteStringCid);
1606 __ j(NOT_EQUAL, &try_two_byte_string, Assembler::kNearJump); 1606 __ j(NOT_EQUAL, &try_two_byte_string, Assembler::kNearJump);
1607 __ SmiUntag(RCX); 1607 __ SmiUntag(RCX);
1608 __ movzxb(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset())); 1608 __ movzxb(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset()));
1609 __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols)); 1609 __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols));
1610 __ j(GREATER_EQUAL, &fall_through); 1610 __ j(GREATER_EQUAL, &fall_through);
1611 const ExternalLabel symbols_label( 1611 __ movq(RAX, Address(THR, Thread::predefined_symbols_address_offset()));
1612 reinterpret_cast<uword>(Symbols::PredefinedAddress()));
1613 __ pushq(PP);
1614 __ LoadPoolPointer();
1615 assembler->set_constant_pool_allowed(true);
1616 __ LoadExternalLabel(RAX, &symbols_label, kNotPatchable);
1617 assembler->set_constant_pool_allowed(false);
1618 __ popq(PP);
1619 __ movq(RAX, Address(RAX, 1612 __ movq(RAX, Address(RAX,
1620 RCX, 1613 RCX,
1621 TIMES_8, 1614 TIMES_8,
1622 Symbols::kNullCharCodeSymbolOffset * kWordSize)); 1615 Symbols::kNullCharCodeSymbolOffset * kWordSize));
1623 __ ret(); 1616 __ ret();
1624 1617
1625 __ Bind(&try_two_byte_string); 1618 __ Bind(&try_two_byte_string);
1626 __ CompareClassId(RAX, kTwoByteStringCid); 1619 __ CompareClassId(RAX, kTwoByteStringCid);
1627 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); 1620 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
1628 ASSERT(kSmiTagShift == 1); 1621 ASSERT(kSmiTagShift == 1);
1629 __ movzxw(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset())); 1622 __ movzxw(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset()));
1630 __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols)); 1623 __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols));
1631 __ j(GREATER_EQUAL, &fall_through); 1624 __ j(GREATER_EQUAL, &fall_through);
1632 __ pushq(PP); 1625 __ movq(RAX, Address(THR, Thread::predefined_symbols_address_offset()));
1633 __ LoadPoolPointer();
1634 assembler->set_constant_pool_allowed(true);
1635 __ LoadExternalLabel(RAX, &symbols_label, kNotPatchable);
1636 assembler->set_constant_pool_allowed(false);
1637 __ popq(PP);
1638 __ movq(RAX, Address(RAX, 1626 __ movq(RAX, Address(RAX,
1639 RCX, 1627 RCX,
1640 TIMES_8, 1628 TIMES_8,
1641 Symbols::kNullCharCodeSymbolOffset * kWordSize)); 1629 Symbols::kNullCharCodeSymbolOffset * kWordSize));
1642 __ ret(); 1630 __ ret();
1643 1631
1644 __ Bind(&fall_through); 1632 __ Bind(&fall_through);
1645 } 1633 }
1646 1634
1647 1635
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
2010 __ LoadIsolate(RAX); 1998 __ LoadIsolate(RAX);
2011 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); 1999 __ movq(RAX, Address(RAX, Isolate::current_tag_offset()));
2012 __ ret(); 2000 __ ret();
2013 } 2001 }
2014 2002
2015 #undef __ 2003 #undef __
2016 2004
2017 } // namespace dart 2005 } // namespace dart
2018 2006
2019 #endif // defined TARGET_ARCH_X64 2007 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698