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

Unified Diff: src/compiler.cc

Issue 2173403002: Replace SmartArrayPointer<T> with unique_ptr<T[]> (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 5 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/graph-visualizer.h » ('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 426752e4bffdab40c0bef8a0df58be1f20184a68..a05ff8f75ac3c382a8791130eadcf72681b5c6c5 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -5,6 +5,7 @@
#include "src/compiler.h"
#include <algorithm>
+#include <memory>
#include "src/asmjs/asm-js.h"
#include "src/asmjs/asm-typer.h"
@@ -181,8 +182,7 @@ bool CompilationInfo::has_simple_parameters() {
return scope()->has_simple_parameters();
}
-
-base::SmartArrayPointer<char> CompilationInfo::GetDebugName() const {
+std::unique_ptr<char[]> CompilationInfo::GetDebugName() const {
if (parse_info() && parse_info()->literal()) {
AllowHandleDereference allow_deref;
return parse_info()->literal()->debug_name()->ToCString();
@@ -192,7 +192,7 @@ base::SmartArrayPointer<char> CompilationInfo::GetDebugName() const {
}
Vector<const char> name_vec = debug_name_;
if (name_vec.is_empty()) name_vec = ArrayVector("unknown");
- base::SmartArrayPointer<char> name(new char[name_vec.length() + 1]);
+ std::unique_ptr<char[]> name(new char[name_vec.length() + 1]);
memcpy(name.get(), name_vec.start(), name_vec.length());
name[name_vec.length()] = '\0';
return name;
« no previous file with comments | « src/compiler.h ('k') | src/compiler/graph-visualizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698