| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |