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

Side by Side Diff: src/asmjs/asm-typer.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, 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/base/smart-pointers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/asmjs/asm-typer.h" 5 #include "src/asmjs/asm-typer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <memory>
9 #include <string> 10 #include <string>
10 11
11 #include "src/v8.h" 12 #include "src/v8.h"
12 13
13 #include "src/asmjs/asm-types.h" 14 #include "src/asmjs/asm-types.h"
14 #include "src/ast/ast.h" 15 #include "src/ast/ast.h"
15 #include "src/ast/scopes.h" 16 #include "src/ast/scopes.h"
16 #include "src/base/bits.h" 17 #include "src/base/bits.h"
17 #include "src/codegen.h" 18 #include "src/codegen.h"
18 #include "src/globals.h" 19 #include "src/globals.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 auto* obj_info = Lookup(obj_as_var_proxy->var()); 307 auto* obj_info = Lookup(obj_as_var_proxy->var());
307 if (obj_info == nullptr) { 308 if (obj_info == nullptr) {
308 return nullptr; 309 return nullptr;
309 } 310 }
310 311
311 if (obj_info->IsFFI()) { 312 if (obj_info->IsFFI()) {
312 // For FFI we can't validate import->key, so assume this is OK. 313 // For FFI we can't validate import->key, so assume this is OK.
313 return obj_info; 314 return obj_info;
314 } 315 }
315 316
316 base::SmartArrayPointer<char> aname = key->AsPropertyName()->ToCString(); 317 std::unique_ptr<char[]> aname = key->AsPropertyName()->ToCString();
317 ObjectTypeMap::iterator i = stdlib->find(std::string(aname.get())); 318 ObjectTypeMap::iterator i = stdlib->find(std::string(aname.get()));
318 if (i == stdlib->end()) { 319 if (i == stdlib->end()) {
319 return nullptr; 320 return nullptr;
320 } 321 }
321 return i->second; 322 return i->second;
322 } 323 }
323 324
324 AsmTyper::VariableInfo* AsmTyper::Lookup(Variable* variable) { 325 AsmTyper::VariableInfo* AsmTyper::Lookup(Variable* variable) {
325 ZoneHashMap* scope = in_function_ ? &local_scope_ : &global_scope_; 326 ZoneHashMap* scope = in_function_ ? &local_scope_ : &global_scope_;
326 ZoneHashMap::Entry* entry = 327 ZoneHashMap::Entry* entry =
(...skipping 2411 matching lines...) Expand 10 before | Expand all | Expand 10 after
2738 return true; 2739 return true;
2739 } 2740 }
2740 2741
2741 *error_message = typer.error_message(); 2742 *error_message = typer.error_message();
2742 return false; 2743 return false;
2743 } 2744 }
2744 2745
2745 } // namespace wasm 2746 } // namespace wasm
2746 } // namespace internal 2747 } // namespace internal
2747 } // namespace v8 2748 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/base/smart-pointers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698