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

Unified Diff: src/arm64/code-stubs-arm64.cc

Issue 200023005: ARM64: Check size of code generated in ProfileEntryHookStub::MaybeCallEntryHook. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/code-stubs-arm64.cc
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc
index 88bffe3c58fddf62195da4af2101757d10178e4f..10ee1ce0075fa651aaa4c2bd193d34a0a5b9e92e 100644
--- a/src/arm64/code-stubs-arm64.cc
+++ b/src/arm64/code-stubs-arm64.cc
@@ -4909,14 +4909,23 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
}
+// The entry hook is a "BumpSystemStackPointer" instruction (sub), followed by
+// a "Push lr" instruction, followed by a call.
+static const unsigned int kProfileEntryHookCallSize =
+ Assembler::kCallSizeWithRelocation + (2 * kInstructionSize);
+
+
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
if (masm->isolate()->function_entry_hook() != NULL) {
- // TODO(all): This needs to be reliably consistent with
- // kReturnAddressDistanceFromFunctionStart in ::Generate.
- Assembler::BlockPoolsScope no_pools(masm);
ProfileEntryHookStub stub;
+ Assembler::BlockConstPoolScope no_const_pools(masm);
+ Label entry_hook_call_start;
+ __ Bind(&entry_hook_call_start);
__ Push(lr);
__ CallStub(&stub);
+ ASSERT(masm->SizeOfCodeGeneratedSince(&entry_hook_call_start) ==
+ kProfileEntryHookCallSize);
+
__ Pop(lr);
}
}
@@ -4924,10 +4933,6 @@ void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm);
- // The entry hook is a "BumpSystemStackPointer" instruction (sub), followed by
- // a "Push lr" instruction, followed by a call.
- static const int kReturnAddressDistanceFromFunctionStart =
- Assembler::kCallSizeWithRelocation + (2 * kInstructionSize);
// Save all kCallerSaved registers (including lr), since this can be called
// from anywhere.
@@ -4937,7 +4942,7 @@ void ProfileEntryHookStub::Generate(MacroAssembler* masm) {
const int kNumSavedRegs = kCallerSaved.Count();
// Compute the function's address as the first argument.
- __ Sub(x0, lr, kReturnAddressDistanceFromFunctionStart);
+ __ Sub(x0, lr, kProfileEntryHookCallSize);
#if V8_HOST_ARCH_ARM64
uintptr_t entry_hook =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698