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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 void MacroAssembler::AssertPositiveOrZero(Register value) { | 1890 void MacroAssembler::AssertPositiveOrZero(Register value) { |
1891 if (emit_debug_code()) { | 1891 if (emit_debug_code()) { |
1892 Label done; | 1892 Label done; |
1893 int sign_bit = value.Is64Bits() ? kXSignBit : kWSignBit; | 1893 int sign_bit = value.Is64Bits() ? kXSignBit : kWSignBit; |
1894 Tbz(value, sign_bit, &done); | 1894 Tbz(value, sign_bit, &done); |
1895 Abort(kUnexpectedNegativeValue); | 1895 Abort(kUnexpectedNegativeValue); |
1896 Bind(&done); | 1896 Bind(&done); |
1897 } | 1897 } |
1898 } | 1898 } |
1899 | 1899 |
1900 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { | 1900 void MacroAssembler::CallStub(CodeStub* stub) { |
1901 DCHECK(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. | 1901 DCHECK(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. |
1902 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); | 1902 Call(stub->GetCode(), RelocInfo::CODE_TARGET); |
1903 } | 1903 } |
1904 | 1904 |
1905 | 1905 |
1906 void MacroAssembler::TailCallStub(CodeStub* stub) { | 1906 void MacroAssembler::TailCallStub(CodeStub* stub) { |
1907 Jump(stub->GetCode(), RelocInfo::CODE_TARGET); | 1907 Jump(stub->GetCode(), RelocInfo::CODE_TARGET); |
1908 } | 1908 } |
1909 | 1909 |
1910 | 1910 |
1911 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 1911 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
1912 int num_arguments, | 1912 int num_arguments, |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 movk(temp, (imm >> 32) & 0xffff, 32); | 2166 movk(temp, (imm >> 32) & 0xffff, 32); |
2167 } else { | 2167 } else { |
2168 Ldr(temp, Immediate(reinterpret_cast<intptr_t>(target), rmode)); | 2168 Ldr(temp, Immediate(reinterpret_cast<intptr_t>(target), rmode)); |
2169 } | 2169 } |
2170 Blr(temp); | 2170 Blr(temp); |
2171 #ifdef DEBUG | 2171 #ifdef DEBUG |
2172 AssertSizeOfCodeGeneratedSince(&start_call, CallSize(target, rmode)); | 2172 AssertSizeOfCodeGeneratedSince(&start_call, CallSize(target, rmode)); |
2173 #endif | 2173 #endif |
2174 } | 2174 } |
2175 | 2175 |
2176 | 2176 void MacroAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode) { |
2177 void MacroAssembler::Call(Handle<Code> code, | |
2178 RelocInfo::Mode rmode, | |
2179 TypeFeedbackId ast_id) { | |
2180 #ifdef DEBUG | 2177 #ifdef DEBUG |
2181 Label start_call; | 2178 Label start_call; |
2182 Bind(&start_call); | 2179 Bind(&start_call); |
2183 #endif | 2180 #endif |
2184 | 2181 |
2185 if ((rmode == RelocInfo::CODE_TARGET) && (!ast_id.IsNone())) { | |
2186 SetRecordedAstId(ast_id); | |
2187 rmode = RelocInfo::CODE_TARGET_WITH_ID; | |
2188 } | |
2189 | |
2190 AllowDeferredHandleDereference embedding_raw_address; | 2182 AllowDeferredHandleDereference embedding_raw_address; |
2191 Call(reinterpret_cast<Address>(code.location()), rmode); | 2183 Call(reinterpret_cast<Address>(code.location()), rmode); |
2192 | 2184 |
2193 #ifdef DEBUG | 2185 #ifdef DEBUG |
2194 // Check the size of the code generated. | 2186 // Check the size of the code generated. |
2195 AssertSizeOfCodeGeneratedSince(&start_call, CallSize(code, rmode, ast_id)); | 2187 AssertSizeOfCodeGeneratedSince(&start_call, CallSize(code, rmode)); |
2196 #endif | 2188 #endif |
2197 } | 2189 } |
2198 | 2190 |
2199 | 2191 |
2200 int MacroAssembler::CallSize(Register target) { | 2192 int MacroAssembler::CallSize(Register target) { |
2201 USE(target); | 2193 USE(target); |
2202 return kInstructionSize; | 2194 return kInstructionSize; |
2203 } | 2195 } |
2204 | 2196 |
2205 | 2197 |
2206 int MacroAssembler::CallSize(Label* target) { | 2198 int MacroAssembler::CallSize(Label* target) { |
2207 USE(target); | 2199 USE(target); |
2208 return kInstructionSize; | 2200 return kInstructionSize; |
2209 } | 2201 } |
2210 | 2202 |
2211 | 2203 |
2212 int MacroAssembler::CallSize(Address target, RelocInfo::Mode rmode) { | 2204 int MacroAssembler::CallSize(Address target, RelocInfo::Mode rmode) { |
2213 USE(target); | 2205 USE(target); |
2214 | 2206 |
2215 // Addresses always have 64 bits, so we shouldn't encounter NONE32. | 2207 // Addresses always have 64 bits, so we shouldn't encounter NONE32. |
2216 DCHECK(rmode != RelocInfo::NONE32); | 2208 DCHECK(rmode != RelocInfo::NONE32); |
2217 | 2209 |
2218 if (rmode == RelocInfo::NONE64) { | 2210 if (rmode == RelocInfo::NONE64) { |
2219 return kCallSizeWithoutRelocation; | 2211 return kCallSizeWithoutRelocation; |
2220 } else { | 2212 } else { |
2221 return kCallSizeWithRelocation; | 2213 return kCallSizeWithRelocation; |
2222 } | 2214 } |
2223 } | 2215 } |
2224 | 2216 |
2225 | 2217 int MacroAssembler::CallSize(Handle<Code> code, RelocInfo::Mode rmode) { |
2226 int MacroAssembler::CallSize(Handle<Code> code, | |
2227 RelocInfo::Mode rmode, | |
2228 TypeFeedbackId ast_id) { | |
2229 USE(code); | 2218 USE(code); |
2230 USE(ast_id); | |
2231 | 2219 |
2232 // Addresses always have 64 bits, so we shouldn't encounter NONE32. | 2220 // Addresses always have 64 bits, so we shouldn't encounter NONE32. |
2233 DCHECK(rmode != RelocInfo::NONE32); | 2221 DCHECK(rmode != RelocInfo::NONE32); |
2234 | 2222 |
2235 if (rmode == RelocInfo::NONE64) { | 2223 if (rmode == RelocInfo::NONE64) { |
2236 return kCallSizeWithoutRelocation; | 2224 return kCallSizeWithoutRelocation; |
2237 } else { | 2225 } else { |
2238 return kCallSizeWithRelocation; | 2226 return kCallSizeWithRelocation; |
2239 } | 2227 } |
2240 } | 2228 } |
(...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4804 } | 4792 } |
4805 | 4793 |
4806 | 4794 |
4807 #undef __ | 4795 #undef __ |
4808 | 4796 |
4809 | 4797 |
4810 } // namespace internal | 4798 } // namespace internal |
4811 } // namespace v8 | 4799 } // namespace v8 |
4812 | 4800 |
4813 #endif // V8_TARGET_ARCH_ARM64 | 4801 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |