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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/ast-expression-visitor.h" | 10 #include "src/ast-expression-visitor.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 } | 106 } |
107 // sum = sum + +log(values[p>>3]); | 107 // sum = sum + +log(values[p>>3]); |
108 CHECK_EXPR(Assignment, expected_type) { | 108 CHECK_EXPR(Assignment, expected_type) { |
109 CHECK_VAR(sum, expected_type); | 109 CHECK_VAR(sum, expected_type); |
110 CHECK_EXPR(BinaryOperation, expected_type) { | 110 CHECK_EXPR(BinaryOperation, expected_type) { |
111 CHECK_VAR(sum, expected_type); | 111 CHECK_VAR(sum, expected_type); |
112 CHECK_EXPR(BinaryOperation, expected_type) { | 112 CHECK_EXPR(BinaryOperation, expected_type) { |
113 CHECK_EXPR(Call, expected_type) { | 113 CHECK_EXPR(Call, expected_type) { |
114 CHECK_VAR(log, expected_type); | 114 CHECK_VAR(log, expected_type); |
115 CHECK_VAR(values, expected_type); | 115 CHECK_EXPR(Property, expected_type) { |
116 CHECK_EXPR(BinaryOperation, expected_type) { | 116 CHECK_VAR(values, expected_type); |
117 CHECK_VAR(p, expected_type); | 117 CHECK_EXPR(BinaryOperation, expected_type) { |
118 CHECK_EXPR(Literal, expected_type); | 118 CHECK_VAR(p, expected_type); |
| 119 CHECK_EXPR(Literal, expected_type); |
| 120 } |
119 } | 121 } |
120 } | 122 } |
121 CHECK_EXPR(Literal, expected_type); | 123 CHECK_EXPR(Literal, expected_type); |
122 } | 124 } |
123 } | 125 } |
124 } | 126 } |
125 // return +sum; | 127 // return +sum; |
126 CHECK_EXPR(BinaryOperation, expected_type) { | 128 CHECK_EXPR(BinaryOperation, expected_type) { |
127 CHECK_VAR(sum, expected_type); | 129 CHECK_VAR(sum, expected_type); |
128 CHECK_EXPR(Literal, expected_type); | 130 CHECK_EXPR(Literal, expected_type); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 172 } |
171 } | 173 } |
172 CHECK_EXPR(Literal, expected_type); | 174 CHECK_EXPR(Literal, expected_type); |
173 } | 175 } |
174 } | 176 } |
175 // "use asm"; | 177 // "use asm"; |
176 CHECK_EXPR(Literal, expected_type); | 178 CHECK_EXPR(Literal, expected_type); |
177 // var exp = stdlib.Math.exp; | 179 // var exp = stdlib.Math.exp; |
178 CHECK_EXPR(Assignment, expected_type) { | 180 CHECK_EXPR(Assignment, expected_type) { |
179 CHECK_VAR(exp, expected_type); | 181 CHECK_VAR(exp, expected_type); |
180 CHECK_VAR(stdlib, expected_type); | 182 CHECK_EXPR(Property, expected_type) { |
181 CHECK_EXPR(Literal, expected_type); | 183 CHECK_EXPR(Property, expected_type) { |
182 CHECK_EXPR(Literal, expected_type); | 184 CHECK_VAR(stdlib, expected_type); |
| 185 CHECK_EXPR(Literal, expected_type); |
| 186 } |
| 187 CHECK_EXPR(Literal, expected_type); |
| 188 } |
183 } | 189 } |
184 // var log = stdlib.Math.log; | 190 // var log = stdlib.Math.log; |
185 CHECK_EXPR(Assignment, expected_type) { | 191 CHECK_EXPR(Assignment, expected_type) { |
186 CHECK_VAR(log, expected_type); | 192 CHECK_VAR(log, expected_type); |
187 CHECK_VAR(stdlib, expected_type); | 193 CHECK_EXPR(Property, expected_type) { |
188 CHECK_EXPR(Literal, expected_type); | 194 CHECK_EXPR(Property, expected_type) { |
189 CHECK_EXPR(Literal, expected_type); | 195 CHECK_VAR(stdlib, expected_type); |
| 196 CHECK_EXPR(Literal, expected_type); |
| 197 } |
| 198 CHECK_EXPR(Literal, expected_type); |
| 199 } |
190 } | 200 } |
191 // var values = new stdlib.Float64Array(buffer); | 201 // var values = new stdlib.Float64Array(buffer); |
192 CHECK_EXPR(Assignment, expected_type) { | 202 CHECK_EXPR(Assignment, expected_type) { |
193 CHECK_VAR(values, expected_type); | 203 CHECK_VAR(values, expected_type); |
194 CHECK_EXPR(CallNew, expected_type) { | 204 CHECK_EXPR(CallNew, expected_type) { |
195 CHECK_VAR(stdlib, expected_type); | 205 CHECK_EXPR(Property, expected_type) { |
196 CHECK_EXPR(Literal, expected_type); | 206 CHECK_VAR(stdlib, expected_type); |
| 207 CHECK_EXPR(Literal, expected_type); |
| 208 } |
197 CHECK_VAR(buffer, expected_type); | 209 CHECK_VAR(buffer, expected_type); |
198 } | 210 } |
199 } | 211 } |
200 // return { geometricMean: geometricMean }; | 212 // return { geometricMean: geometricMean }; |
201 CHECK_EXPR(ObjectLiteral, expected_type) { | 213 CHECK_EXPR(ObjectLiteral, expected_type) { |
202 CHECK_VAR(geometricMean, expected_type); | 214 CHECK_VAR(geometricMean, expected_type); |
203 } | 215 } |
204 } | 216 } |
205 } | 217 } |
206 CHECK_TYPES_END | 218 CHECK_TYPES_END |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 TypeSetter(&compilation_info).Run(); | 288 TypeSetter(&compilation_info).Run(); |
277 | 289 |
278 ExpressionTypeCollector(&compilation_info, &types).Run(); | 290 ExpressionTypeCollector(&compilation_info, &types).Run(); |
279 CheckAllSame(types, INT32_TYPE); | 291 CheckAllSame(types, INT32_TYPE); |
280 | 292 |
281 TypingReseter(&compilation_info).Run(); | 293 TypingReseter(&compilation_info).Run(); |
282 | 294 |
283 ExpressionTypeCollector(&compilation_info, &types).Run(); | 295 ExpressionTypeCollector(&compilation_info, &types).Run(); |
284 CheckAllSame(types, DEFAULT_TYPE); | 296 CheckAllSame(types, DEFAULT_TYPE); |
285 } | 297 } |
OLD | NEW |