Commit 30b57dcd authored by ofrobots's avatar ofrobots Committed by Commit bot

Revert of improve perf_basic_prof filename reporting (patchset #4 id:60001 of...

Revert of improve perf_basic_prof filename reporting (patchset #4 id:60001 of https://codereview.chromium.org/1396843004/ )

Reason for revert:
The test-case has issues on windows. http://build.chromium.org/p/client.v8/builders/V8%20Win32%20-%20debug%20-%203/builds/5011/steps/Check/logs/stdio

Original issue's description:
> improve perf_basic_prof filename reporting
>
> Re-implement https://codereview.chromium.org/1388543002 after fixing the issue
> with SNPrintF crashing on windows when a zero-length buffer is passed in.
>
> R=jkummerow@chromium.org,yangguo@chromium.org,yurys@chromium.org
> BUG=chromium:539892
> LOG=N
>
> Committed: https://crrev.com/701ba0b255f9c34f4b8c43584ef1e35040474e7d
> Cr-Commit-Position: refs/heads/master@{#31197}

TBR=jkummerow@chromium.org,yangguo@chromium.org,yurys@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:539892

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

Cr-Commit-Position: refs/heads/master@{#31198}
parent 701ba0b2
...@@ -123,9 +123,8 @@ class CodeEventLogger::NameBuffer { ...@@ -123,9 +123,8 @@ class CodeEventLogger::NameBuffer {
} }
void AppendInt(int n) { void AppendInt(int n) {
int space = kUtf8BufferSize - utf8_pos_; Vector<char> buffer(utf8_buffer_ + utf8_pos_,
if (space <= 0) return; kUtf8BufferSize - utf8_pos_);
Vector<char> buffer(utf8_buffer_ + utf8_pos_, space);
int size = SNPrintF(buffer, "%d", n); int size = SNPrintF(buffer, "%d", n);
if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) { if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
utf8_pos_ += size; utf8_pos_ += size;
...@@ -133,9 +132,8 @@ class CodeEventLogger::NameBuffer { ...@@ -133,9 +132,8 @@ class CodeEventLogger::NameBuffer {
} }
void AppendHex(uint32_t n) { void AppendHex(uint32_t n) {
int space = kUtf8BufferSize - utf8_pos_; Vector<char> buffer(utf8_buffer_ + utf8_pos_,
if (space <= 0) return; kUtf8BufferSize - utf8_pos_);
Vector<char> buffer(utf8_buffer_ + utf8_pos_, space);
int size = SNPrintF(buffer, "%x", n); int size = SNPrintF(buffer, "%x", n);
if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) { if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
utf8_pos_ += size; utf8_pos_ += size;
...@@ -147,7 +145,7 @@ class CodeEventLogger::NameBuffer { ...@@ -147,7 +145,7 @@ class CodeEventLogger::NameBuffer {
private: private:
static const int kUtf8BufferSize = 512; static const int kUtf8BufferSize = 512;
static const int kUtf16BufferSize = kUtf8BufferSize; static const int kUtf16BufferSize = 128;
int utf8_pos_; int utf8_pos_;
char utf8_buffer_[kUtf8BufferSize]; char utf8_buffer_[kUtf8BufferSize];
......
...@@ -531,50 +531,3 @@ TEST(LogVersion) { ...@@ -531,50 +531,3 @@ TEST(LogVersion) {
} }
isolate->Dispose(); isolate->Dispose();
} }
// https://crbug.com/539892
// CodeCreateEvents with really large names should not crash.
TEST(Issue539892) {
SETUP_FLAGS();
bool saved_perf_basic_prof = i::FLAG_perf_basic_prof;
i::FLAG_perf_basic_prof = true;
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params);
{
ScopedLoggerInitializer initialize_logger(saved_log, saved_prof, isolate);
Logger* logger = initialize_logger.logger();
// Function with a really large name.
const char* source_text =
"(function "
"baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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ions();
}
isolate->Dispose();
i::FLAG_perf_basic_prof = saved_perf_basic_prof;
}
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