OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/typing-asm.h" | 7 #include "src/typing-asm.h" |
8 | 8 |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 do { \ | 36 do { \ |
37 DCHECK(!HasStackOverflow()); \ | 37 DCHECK(!HasStackOverflow()); \ |
38 call; \ | 38 call; \ |
39 if (HasStackOverflow()) return; \ | 39 if (HasStackOverflow()) return; \ |
40 if (!valid_) return; \ | 40 if (!valid_) return; \ |
41 } while (false) | 41 } while (false) |
42 | 42 |
43 | 43 |
44 AsmTyper::AsmTyper(Isolate* isolate, Zone* zone, Script* script, | 44 AsmTyper::AsmTyper(Isolate* isolate, Zone* zone, Script* script, |
45 FunctionLiteral* root) | 45 FunctionLiteral* root) |
46 : script_(script), | 46 : zone_(zone), |
| 47 script_(script), |
47 root_(root), | 48 root_(root), |
48 valid_(true), | 49 valid_(true), |
49 stdlib_types_(zone), | 50 stdlib_types_(zone), |
50 stdlib_heap_types_(zone), | 51 stdlib_heap_types_(zone), |
51 stdlib_math_types_(zone), | 52 stdlib_math_types_(zone), |
52 global_variable_type_(HashMap::PointersMatch, | 53 global_variable_type_(HashMap::PointersMatch, |
53 ZoneHashMap::kDefaultHashMapCapacity, | 54 ZoneHashMap::kDefaultHashMapCapacity, |
54 ZoneAllocationPolicy(zone)), | 55 ZoneAllocationPolicy(zone)), |
55 local_variable_type_(HashMap::PointersMatch, | 56 local_variable_type_(HashMap::PointersMatch, |
56 ZoneHashMap::kDefaultHashMapCapacity, | 57 ZoneHashMap::kDefaultHashMapCapacity, |
57 ZoneAllocationPolicy(zone)), | 58 ZoneAllocationPolicy(zone)), |
58 in_function_(false), | 59 in_function_(false), |
59 building_function_tables_(false), | 60 building_function_tables_(false), |
60 cache_(kCache.Get()) { | 61 cache_(kCache.Get()) { |
61 InitializeAstVisitor(isolate, zone); | 62 InitializeAstVisitor(isolate); |
62 InitializeStdlib(); | 63 InitializeStdlib(); |
63 } | 64 } |
64 | 65 |
65 | 66 |
66 bool AsmTyper::Validate() { | 67 bool AsmTyper::Validate() { |
67 VisitAsmModule(root_); | 68 VisitAsmModule(root_); |
68 return valid_ && !HasStackOverflow(); | 69 return valid_ && !HasStackOverflow(); |
69 } | 70 } |
70 | 71 |
71 | 72 |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 computed_type_->Print(); | 1068 computed_type_->Print(); |
1068 PrintF("Expected type: "); | 1069 PrintF("Expected type: "); |
1069 expected_type_->Print(); | 1070 expected_type_->Print(); |
1070 #endif | 1071 #endif |
1071 FAIL(expr, msg); | 1072 FAIL(expr, msg); |
1072 } | 1073 } |
1073 expected_type_ = save; | 1074 expected_type_ = save; |
1074 } | 1075 } |
1075 } // namespace internal | 1076 } // namespace internal |
1076 } // namespace v8 | 1077 } // namespace v8 |
OLD | NEW |