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

Unified Diff: src/compiler.cc

Issue 1297203002: Add CompileInfo::GetDebugName() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@interpreter_immed_bytecodes
Patch Set: Fix test crash Created 5 years, 4 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 | « src/compiler.h ('k') | src/compiler/arm/code-generator-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 9ce666c911a3edb95498371c81fee474ed993121..6637cd72c8e2f9aa0bdcc4adda9954fd3d2668d3 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -119,7 +119,7 @@ bool CompilationInfo::has_scope() const {
CompilationInfo::CompilationInfo(ParseInfo* parse_info)
- : CompilationInfo(parse_info, nullptr, BASE, parse_info->isolate(),
+ : CompilationInfo(parse_info, nullptr, nullptr, BASE, parse_info->isolate(),
parse_info->zone()) {
// Compiling for the snapshot typically results in different code than
// compiling later on. This means that code recompiled with deoptimization
@@ -148,11 +148,16 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info)
CompilationInfo::CompilationInfo(CodeStub* stub, Isolate* isolate, Zone* zone)
- : CompilationInfo(nullptr, stub, STUB, isolate, zone) {}
+ : CompilationInfo(nullptr, stub, CodeStub::MajorName(stub->MajorKey()),
+ STUB, isolate, zone) {}
+CompilationInfo::CompilationInfo(const char* debug_name, Isolate* isolate,
+ Zone* zone)
+ : CompilationInfo(nullptr, nullptr, debug_name, STUB, isolate, zone) {}
CompilationInfo::CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub,
- Mode mode, Isolate* isolate, Zone* zone)
+ const char* code_stub_debug_name, Mode mode,
+ Isolate* isolate, Zone* zone)
: parse_info_(parse_info),
isolate_(isolate),
flags_(0),
@@ -173,7 +178,8 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub,
parameter_count_(0),
optimization_id_(-1),
osr_expr_stack_height_(0),
- function_type_(nullptr) {
+ function_type_(nullptr),
+ code_stub_debug_name_(code_stub_debug_name) {
// Parameter count is number of stack parameters.
if (code_stub_ != NULL) {
CodeStubDescriptor descriptor(code_stub_);
@@ -197,6 +203,13 @@ CompilationInfo::~CompilationInfo() {
}
+void CompilationInfo::SetStub(CodeStub* code_stub) {
+ SetMode(STUB);
+ code_stub_ = code_stub;
+ code_stub_debug_name_ = CodeStub::MajorName(code_stub->MajorKey());
+}
+
+
int CompilationInfo::num_parameters() const {
return has_scope() ? scope()->num_parameters() : parameter_count_;
}
@@ -310,6 +323,19 @@ Handle<Code> CompilationInfo::GenerateCodeStub() {
}
+base::SmartArrayPointer<char> CompilationInfo::GetDebugName() const {
+ if (IsStub()) {
+ size_t len = strlen(code_stub_debug_name_) + 1;
+ base::SmartArrayPointer<char> name(new char[len]);
+ memcpy(name.get(), code_stub_debug_name_, len);
+ return name;
+ } else {
+ AllowHandleDereference allow_deref;
+ return literal()->debug_name()->ToCString();
+ }
+}
+
+
class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder {
public:
explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info)
« no previous file with comments | « src/compiler.h ('k') | src/compiler/arm/code-generator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698