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

Side by Side Diff: src/arm64/assembler-arm64.h

Issue 227043010: ARM64: Avoid iterating through all unresolved branch infos when many are pending. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Always traverse the link chain to delete branch info Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm64/assembler-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 void db(uint8_t data) { dc8(data); } 1687 void db(uint8_t data) { dc8(data); }
1688 1688
1689 // Code generation helpers -------------------------------------------------- 1689 // Code generation helpers --------------------------------------------------
1690 1690
1691 unsigned num_pending_reloc_info() const { return num_pending_reloc_info_; } 1691 unsigned num_pending_reloc_info() const { return num_pending_reloc_info_; }
1692 1692
1693 Instruction* InstructionAt(int offset) const { 1693 Instruction* InstructionAt(int offset) const {
1694 return reinterpret_cast<Instruction*>(buffer_ + offset); 1694 return reinterpret_cast<Instruction*>(buffer_ + offset);
1695 } 1695 }
1696 1696
1697 ptrdiff_t InstructionOffset(Instruction* instr) const {
1698 return reinterpret_cast<byte*>(instr) - buffer_;
1699 }
1700
1697 // Register encoding. 1701 // Register encoding.
1698 static Instr Rd(CPURegister rd) { 1702 static Instr Rd(CPURegister rd) {
1699 ASSERT(rd.code() != kSPRegInternalCode); 1703 ASSERT(rd.code() != kSPRegInternalCode);
1700 return rd.code() << Rd_offset; 1704 return rd.code() << Rd_offset;
1701 } 1705 }
1702 1706
1703 static Instr Rn(CPURegister rn) { 1707 static Instr Rn(CPURegister rn) {
1704 ASSERT(rn.code() != kSPRegInternalCode); 1708 ASSERT(rn.code() != kSPRegInternalCode);
1705 return rn.code() << Rn_offset; 1709 return rn.code() << Rn_offset;
1706 } 1710 }
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 // It is maintained to the closest unresolved branch limit minus the maximum 2179 // It is maintained to the closest unresolved branch limit minus the maximum
2176 // veneer margin (or kMaxInt if there are no unresolved branches). 2180 // veneer margin (or kMaxInt if there are no unresolved branches).
2177 int next_veneer_pool_check_; 2181 int next_veneer_pool_check_;
2178 2182
2179 private: 2183 private:
2180 // If a veneer is emitted for a branch instruction, that instruction must be 2184 // If a veneer is emitted for a branch instruction, that instruction must be
2181 // removed from the associated label's link chain so that the assembler does 2185 // removed from the associated label's link chain so that the assembler does
2182 // not later attempt (likely unsuccessfully) to patch it to branch directly to 2186 // not later attempt (likely unsuccessfully) to patch it to branch directly to
2183 // the label. 2187 // the label.
2184 void DeleteUnresolvedBranchInfoForLabel(Label* label); 2188 void DeleteUnresolvedBranchInfoForLabel(Label* label);
2189 // This function deletes the information related to the label by traversing
2190 // the label chain, and for each PC-relative instruction in the chain checking
2191 // if pending unresolved information exists. Its complexity is proportional to
2192 // the length of the label chain.
2193 void DeleteUnresolvedBranchInfoForLabelTraverse(Label* label);
2185 2194
2186 private: 2195 private:
2187 PositionsRecorder positions_recorder_; 2196 PositionsRecorder positions_recorder_;
2188 friend class PositionsRecorder; 2197 friend class PositionsRecorder;
2189 friend class EnsureSpace; 2198 friend class EnsureSpace;
2190 }; 2199 };
2191 2200
2192 class PatchingAssembler : public Assembler { 2201 class PatchingAssembler : public Assembler {
2193 public: 2202 public:
2194 // Create an Assembler with a buffer starting at 'start'. 2203 // Create an Assembler with a buffer starting at 'start'.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 class EnsureSpace BASE_EMBEDDED { 2247 class EnsureSpace BASE_EMBEDDED {
2239 public: 2248 public:
2240 explicit EnsureSpace(Assembler* assembler) { 2249 explicit EnsureSpace(Assembler* assembler) {
2241 assembler->CheckBuffer(); 2250 assembler->CheckBuffer();
2242 } 2251 }
2243 }; 2252 };
2244 2253
2245 } } // namespace v8::internal 2254 } } // namespace v8::internal
2246 2255
2247 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ 2256 #endif // V8_ARM64_ASSEMBLER_ARM64_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm64/assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698