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 <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 void AsmTyper::VariableInfo::SetFirstForwardUse(int source_location) { | 167 void AsmTyper::VariableInfo::SetFirstForwardUse(int source_location) { |
168 DCHECK(source_location_ == -1); | 168 DCHECK(source_location_ == -1); |
169 missing_definition_ = true; | 169 missing_definition_ = true; |
170 source_location_ = source_location; | 170 source_location_ = source_location; |
171 } | 171 } |
172 | 172 |
173 // ---------------------------------------------------------------------------- | 173 // ---------------------------------------------------------------------------- |
174 // Implementation of AsmTyper | 174 // Implementation of AsmTyper |
175 | 175 |
176 AsmTyper::AsmTyper(Isolate* isolate, Zone* zone, Script* script, | 176 AsmTyper::AsmTyper(Isolate* isolate, Zone* zone, Handle<Script> script, |
177 FunctionLiteral* root) | 177 FunctionLiteral* root) |
178 : isolate_(isolate), | 178 : isolate_(isolate), |
179 zone_(zone), | 179 zone_(zone), |
180 script_(script), | 180 script_(script), |
181 root_(root), | 181 root_(root), |
182 forward_definitions_(zone), | 182 forward_definitions_(zone), |
183 ffi_use_signatures_(zone), | 183 ffi_use_signatures_(zone), |
184 stdlib_types_(zone), | 184 stdlib_types_(zone), |
185 stdlib_math_types_(zone), | 185 stdlib_math_types_(zone), |
186 module_info_(VariableInfo::ForSpecialSymbol(zone_, kModule)), | 186 module_info_(VariableInfo::ForSpecialSymbol(zone_, kModule)), |
(...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2859 | 2859 |
2860 if (!heap_var_info->IsHeap()) { | 2860 if (!heap_var_info->IsHeap()) { |
2861 FAIL(heap, | 2861 FAIL(heap, |
2862 "Heap view creation parameter should be the module's heap parameter."); | 2862 "Heap view creation parameter should be the module's heap parameter."); |
2863 } | 2863 } |
2864 | 2864 |
2865 DCHECK(heap_view_info->type()->IsA(AsmType::Heap())); | 2865 DCHECK(heap_view_info->type()->IsA(AsmType::Heap())); |
2866 return heap_view_info->type(); | 2866 return heap_view_info->type(); |
2867 } | 2867 } |
2868 | 2868 |
2869 bool IsValidAsm(Isolate* isolate, Zone* zone, Script* script, | 2869 bool IsValidAsm(Isolate* isolate, Zone* zone, Handle<Script> script, |
2870 FunctionLiteral* root, std::string* error_message) { | 2870 FunctionLiteral* root, std::string* error_message) { |
2871 error_message->clear(); | 2871 error_message->clear(); |
2872 | 2872 |
2873 AsmTyper typer(isolate, zone, script, root); | 2873 AsmTyper typer(isolate, zone, script, root); |
2874 if (typer.Validate()) { | 2874 if (typer.Validate()) { |
2875 return true; | 2875 return true; |
2876 } | 2876 } |
2877 | 2877 |
2878 *error_message = typer.error_message(); | 2878 *error_message = typer.error_message(); |
2879 return false; | 2879 return false; |
2880 } | 2880 } |
2881 | 2881 |
2882 } // namespace wasm | 2882 } // namespace wasm |
2883 } // namespace internal | 2883 } // namespace internal |
2884 } // namespace v8 | 2884 } // namespace v8 |
OLD | NEW |