Commit 7be25551 authored by bmeurer's avatar bmeurer Committed by Commit bot

Revert "[profiler] Make no frame region detection code more robust", "Fix ASAN...

Revert "[profiler] Make no frame region detection code more robust", "Fix ASAN after r30777" and "Fix MSAN warning after r30777 (try 2)"

This reverts commits 12c7bc9a,
cb0b3592, and
a6e00c6a, because they introduced weird
flaky crashes in random places now at least in the arm simulator, where
it see that quite often now on different change sets, i.e. see

http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm_rel/builds/8138/steps/Check%20%28flakes%29/logs/LoadICFastApi_DirectC..

and

https://chromegw.corp.google.com/i/client.v8/builders/V8%20Linux%20-%20mipsel%20-%20sim/builds/2566/steps/Check%20%28flakes%29/logs/LoadICFastApi_DirectC..

for example.

TBR=alph@chromium.org
BUG=chromium:529931
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
LOG=N

Review URL: https://codereview.chromium.org/1354573002

Cr-Commit-Position: refs/heads/master@{#30786}
parent a6e00c6a
......@@ -173,69 +173,6 @@ class PlatformDataCommon : public Malloced {
ThreadId profiled_thread_id_;
};
bool IsSamePage(byte* ptr1, byte* ptr2) {
const uint32_t kPageSize = 4096;
uintptr_t mask = ~static_cast<uintptr_t>(kPageSize - 1);
return (reinterpret_cast<uintptr_t>(ptr1) & mask) ==
(reinterpret_cast<uintptr_t>(ptr2) & mask);
}
// Check if the code at specified address could potentially be a
// frame setup code.
bool IsNoFrameRegion(Address address) {
struct Pattern {
int bytes_count;
byte bytes[8];
int offsets[4];
};
byte* pc = reinterpret_cast<byte*>(address);
static Pattern patterns[] = {
#if V8_HOST_ARCH_IA32
// push %ebp
// mov %esp,%ebp
{3, {0x55, 0x89, 0xe5}, {0, 1, -1}},
// pop %ebp
// ret N
{2, {0x5d, 0xc2}, {0, 1, -1}},
// pop %ebp
// ret
{2, {0x5d, 0xc3}, {0, 1, -1}},
#elif V8_HOST_ARCH_X64
// pushq %rbp
// movq %rsp,%rbp
{4, {0x55, 0x48, 0x89, 0xe5}, {0, 1, -1}},
// popq %rbp
// ret N
{2, {0x5d, 0xc2}, {0, 1, -1}},
// popq %rbp
// ret
{2, {0x5d, 0xc3}, {0, 1, -1}},
#endif
{0, {}, {}}
};
for (Pattern* pattern = patterns; pattern->bytes_count; ++pattern) {
for (int* offset_ptr = pattern->offsets; *offset_ptr != -1; ++offset_ptr) {
int offset = *offset_ptr;
if (!offset || IsSamePage(pc, pc - offset)) {
MSAN_MEMORY_IS_INITIALIZED(pc - offset, pattern->bytes_count);
if (!memcmp(pc - offset, pattern->bytes, pattern->bytes_count))
return true;
} else {
// It is not safe to examine bytes on another page as it might not be
// allocated thus causing a SEGFAULT.
// Check the pattern part that's on the same page and
// pessimistically assume it could be the entire pattern match.
MSAN_MEMORY_IS_INITIALIZED(pc, pattern->bytes_count - offset);
if (!memcmp(pc, pattern->bytes + offset, pattern->bytes_count - offset))
return true;
}
}
}
return false;
}
} // namespace
#if defined(USE_SIGNALS)
......@@ -655,11 +592,6 @@ DISABLE_ASAN void TickSample::Init(Isolate* isolate,
Address js_entry_sp = isolate->js_entry_sp();
if (js_entry_sp == 0) return; // Not executing JS now.
if (pc && IsNoFrameRegion(pc)) {
pc = 0;
return;
}
ExternalCallbackScope* scope = isolate->external_callback_scope();
Address handler = Isolate::handler(isolate->thread_local_top());
// If there is a handler on top of the external callback scope then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment