| 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" |
| 11 #include "src/scopes.h" | 11 #include "src/scopes.h" |
| 12 #include "src/zone-type-cache.h" | 12 #include "src/type-cache.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 namespace { | |
| 17 | |
| 18 base::LazyInstance<ZoneTypeCache>::type kCache = LAZY_INSTANCE_INITIALIZER; | |
| 19 | |
| 20 } // namespace | |
| 21 | |
| 22 | 16 |
| 23 #define FAIL(node, msg) \ | 17 #define FAIL(node, msg) \ |
| 24 do { \ | 18 do { \ |
| 25 valid_ = false; \ | 19 valid_ = false; \ |
| 26 int line = node->position() == RelocInfo::kNoPosition \ | 20 int line = node->position() == RelocInfo::kNoPosition \ |
| 27 ? -1 \ | 21 ? -1 \ |
| 28 : script_->GetLineNumber(node->position()); \ | 22 : script_->GetLineNumber(node->position()); \ |
| 29 base::OS::SNPrintF(error_message_, sizeof(error_message_), \ | 23 base::OS::SNPrintF(error_message_, sizeof(error_message_), \ |
| 30 "asm: line %d: %s\n", line + 1, msg); \ | 24 "asm: line %d: %s\n", line + 1, msg); \ |
| 31 return; \ | 25 return; \ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 51 stdlib_heap_types_(zone), | 45 stdlib_heap_types_(zone), |
| 52 stdlib_math_types_(zone), | 46 stdlib_math_types_(zone), |
| 53 global_variable_type_(HashMap::PointersMatch, | 47 global_variable_type_(HashMap::PointersMatch, |
| 54 ZoneHashMap::kDefaultHashMapCapacity, | 48 ZoneHashMap::kDefaultHashMapCapacity, |
| 55 ZoneAllocationPolicy(zone)), | 49 ZoneAllocationPolicy(zone)), |
| 56 local_variable_type_(HashMap::PointersMatch, | 50 local_variable_type_(HashMap::PointersMatch, |
| 57 ZoneHashMap::kDefaultHashMapCapacity, | 51 ZoneHashMap::kDefaultHashMapCapacity, |
| 58 ZoneAllocationPolicy(zone)), | 52 ZoneAllocationPolicy(zone)), |
| 59 in_function_(false), | 53 in_function_(false), |
| 60 building_function_tables_(false), | 54 building_function_tables_(false), |
| 61 cache_(kCache.Get()) { | 55 cache_(TypeCache::Get()) { |
| 62 InitializeAstVisitor(isolate); | 56 InitializeAstVisitor(isolate); |
| 63 InitializeStdlib(); | 57 InitializeStdlib(); |
| 64 } | 58 } |
| 65 | 59 |
| 66 | 60 |
| 67 bool AsmTyper::Validate() { | 61 bool AsmTyper::Validate() { |
| 68 VisitAsmModule(root_); | 62 VisitAsmModule(root_); |
| 69 return valid_ && !HasStackOverflow(); | 63 return valid_ && !HasStackOverflow(); |
| 70 } | 64 } |
| 71 | 65 |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 computed_type_->Print(); | 1067 computed_type_->Print(); |
| 1074 PrintF("Expected type: "); | 1068 PrintF("Expected type: "); |
| 1075 expected_type_->Print(); | 1069 expected_type_->Print(); |
| 1076 #endif | 1070 #endif |
| 1077 FAIL(expr, msg); | 1071 FAIL(expr, msg); |
| 1078 } | 1072 } |
| 1079 expected_type_ = save; | 1073 expected_type_ = save; |
| 1080 } | 1074 } |
| 1081 } // namespace internal | 1075 } // namespace internal |
| 1082 } // namespace v8 | 1076 } // namespace v8 |
| OLD | NEW |