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

Unified Diff: src/perf-jit.cc

Issue 2562973002: [perf-prof] fix crash when logging. (Closed)
Patch Set: remove stray edit Created 4 years 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 | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/perf-jit.cc
diff --git a/src/perf-jit.cc b/src/perf-jit.cc
index 6641a1259b0278442bb0c3b1535f069242089d16..ed592fd96a58fb7dabdd3adbef9e41f2c9125bed 100644
--- a/src/perf-jit.cc
+++ b/src/perf-jit.cc
@@ -247,6 +247,7 @@ void PerfJitLogger::LogRecordedBuffer(AbstractCode* abstract_code,
}
void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
+ DisallowHeapAllocation no_gc;
// Compute the entry count and get the name of the script.
uint32_t entry_count = 0;
for (SourcePositionTableIterator iterator(code->source_position_table());
@@ -254,14 +255,14 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
entry_count++;
}
if (entry_count == 0) return;
- Handle<Script> script(Script::cast(shared->script()));
- Handle<Object> name_or_url(Script::GetNameOrSourceURL(script));
+ Script* script = Script::cast(shared->script());
+ Object* name_or_url = script->GetNameOrSourceURL();
int name_length = 0;
std::unique_ptr<char[]> name_string;
if (name_or_url->IsString()) {
name_string =
- Handle<String>::cast(name_or_url)
+ String::cast(name_or_url)
->ToCString(DISALLOW_NULLS, FAST_STRING_TRAVERSAL, &name_length);
Tobias Tebbi 2016/12/09 12:53:26 only ROBUST_STRING_TRAVERSAL seems to guarantee no
Yang 2016/12/09 14:00:36 Not sure I understand. I don't think ToCString can
DCHECK_EQ(0, name_string.get()[name_length]);
} else {
@@ -294,13 +295,13 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
LogWriteBytes(reinterpret_cast<const char*>(&debug_info), sizeof(debug_info));
int script_line_offset = script->line_offset();
- Handle<FixedArray> line_ends(FixedArray::cast(script->line_ends()));
+ FixedArray* line_ends = FixedArray::cast(script->line_ends());
Address code_start = code->instruction_start();
for (SourcePositionTableIterator iterator(code->source_position_table());
!iterator.done(); iterator.Advance()) {
int position = iterator.source_position().ScriptOffset();
- int line_number = Script::GetLineNumber(script, position);
+ int line_number = script->GetLineNumber(position);
// Compute column.
int relative_line_number = line_number - script_line_offset;
int start =
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698