| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/flags.h" | 5 #include "src/base/flags.h" |
| 6 #include "src/bootstrapper.h" | 6 #include "src/bootstrapper.h" |
| 7 #include "src/compiler/graph-reducer.h" | 7 #include "src/compiler/graph-reducer.h" |
| 8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
| 9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 COMMON_OP_LIST(DECLARE_CASE) | 246 COMMON_OP_LIST(DECLARE_CASE) |
| 247 SIMPLIFIED_OP_LIST(DECLARE_CASE) | 247 SIMPLIFIED_OP_LIST(DECLARE_CASE) |
| 248 MACHINE_OP_LIST(DECLARE_CASE) | 248 MACHINE_OP_LIST(DECLARE_CASE) |
| 249 JS_SIMPLE_UNOP_LIST(DECLARE_CASE) | 249 JS_SIMPLE_UNOP_LIST(DECLARE_CASE) |
| 250 JS_OBJECT_OP_LIST(DECLARE_CASE) | 250 JS_OBJECT_OP_LIST(DECLARE_CASE) |
| 251 JS_CONTEXT_OP_LIST(DECLARE_CASE) | 251 JS_CONTEXT_OP_LIST(DECLARE_CASE) |
| 252 JS_OTHER_OP_LIST(DECLARE_CASE) | 252 JS_OTHER_OP_LIST(DECLARE_CASE) |
| 253 #undef DECLARE_CASE | 253 #undef DECLARE_CASE |
| 254 | 254 |
| 255 #define DECLARE_CASE(x) case IrOpcode::k##x: | 255 #define DECLARE_CASE(x) case IrOpcode::k##x: |
| 256 DECLARE_CASE(Dead) | |
| 257 DECLARE_CASE(Loop) | 256 DECLARE_CASE(Loop) |
| 258 DECLARE_CASE(Branch) | 257 DECLARE_CASE(Branch) |
| 259 DECLARE_CASE(IfTrue) | 258 DECLARE_CASE(IfTrue) |
| 260 DECLARE_CASE(IfFalse) | 259 DECLARE_CASE(IfFalse) |
| 261 DECLARE_CASE(IfSuccess) | 260 DECLARE_CASE(IfSuccess) |
| 262 DECLARE_CASE(Switch) | 261 DECLARE_CASE(Switch) |
| 263 DECLARE_CASE(IfValue) | 262 DECLARE_CASE(IfValue) |
| 264 DECLARE_CASE(IfDefault) | 263 DECLARE_CASE(IfDefault) |
| 265 DECLARE_CASE(Merge) | 264 DECLARE_CASE(Merge) |
| 266 DECLARE_CASE(Deoptimize) | 265 DECLARE_CASE(Deoptimize) |
| 267 DECLARE_CASE(Return) | 266 DECLARE_CASE(Return) |
| 268 DECLARE_CASE(TailCall) | 267 DECLARE_CASE(TailCall) |
| 269 DECLARE_CASE(Terminate) | 268 DECLARE_CASE(Terminate) |
| 270 DECLARE_CASE(OsrNormalEntry) | 269 DECLARE_CASE(OsrNormalEntry) |
| 271 DECLARE_CASE(OsrLoopEntry) | 270 DECLARE_CASE(OsrLoopEntry) |
| 271 DECLARE_CASE(DeadControl) |
| 272 DECLARE_CASE(Throw) | 272 DECLARE_CASE(Throw) |
| 273 DECLARE_CASE(End) | 273 DECLARE_CASE(End) |
| 274 #undef DECLARE_CASE | 274 #undef DECLARE_CASE |
| 275 break; | 275 break; |
| 276 } | 276 } |
| 277 return NoChange(); | 277 return NoChange(); |
| 278 } | 278 } |
| 279 | 279 |
| 280 Bounds TypeNode(Node* node) { | 280 Bounds TypeNode(Node* node) { |
| 281 switch (node->opcode()) { | 281 switch (node->opcode()) { |
| 282 #define DECLARE_CASE(x) \ | 282 #define DECLARE_CASE(x) \ |
| 283 case IrOpcode::k##x: return TypeBinaryOp(node, x##Typer); | 283 case IrOpcode::k##x: return TypeBinaryOp(node, x##Typer); |
| 284 JS_SIMPLE_BINOP_LIST(DECLARE_CASE) | 284 JS_SIMPLE_BINOP_LIST(DECLARE_CASE) |
| 285 #undef DECLARE_CASE | 285 #undef DECLARE_CASE |
| 286 | 286 |
| 287 #define DECLARE_CASE(x) case IrOpcode::k##x: return Type##x(node); | 287 #define DECLARE_CASE(x) case IrOpcode::k##x: return Type##x(node); |
| 288 DECLARE_CASE(Start) | 288 DECLARE_CASE(Start) |
| 289 DECLARE_CASE(IfException) | 289 DECLARE_CASE(IfException) |
| 290 // VALUE_OP_LIST without JS_SIMPLE_BINOP_LIST: | 290 // VALUE_OP_LIST without JS_SIMPLE_BINOP_LIST: |
| 291 COMMON_OP_LIST(DECLARE_CASE) | 291 COMMON_OP_LIST(DECLARE_CASE) |
| 292 SIMPLIFIED_OP_LIST(DECLARE_CASE) | 292 SIMPLIFIED_OP_LIST(DECLARE_CASE) |
| 293 MACHINE_OP_LIST(DECLARE_CASE) | 293 MACHINE_OP_LIST(DECLARE_CASE) |
| 294 JS_SIMPLE_UNOP_LIST(DECLARE_CASE) | 294 JS_SIMPLE_UNOP_LIST(DECLARE_CASE) |
| 295 JS_OBJECT_OP_LIST(DECLARE_CASE) | 295 JS_OBJECT_OP_LIST(DECLARE_CASE) |
| 296 JS_CONTEXT_OP_LIST(DECLARE_CASE) | 296 JS_CONTEXT_OP_LIST(DECLARE_CASE) |
| 297 JS_OTHER_OP_LIST(DECLARE_CASE) | 297 JS_OTHER_OP_LIST(DECLARE_CASE) |
| 298 #undef DECLARE_CASE | 298 #undef DECLARE_CASE |
| 299 | 299 |
| 300 #define DECLARE_CASE(x) case IrOpcode::k##x: | 300 #define DECLARE_CASE(x) case IrOpcode::k##x: |
| 301 DECLARE_CASE(Dead) | |
| 302 DECLARE_CASE(Loop) | 301 DECLARE_CASE(Loop) |
| 303 DECLARE_CASE(Branch) | 302 DECLARE_CASE(Branch) |
| 304 DECLARE_CASE(IfTrue) | 303 DECLARE_CASE(IfTrue) |
| 305 DECLARE_CASE(IfFalse) | 304 DECLARE_CASE(IfFalse) |
| 306 DECLARE_CASE(IfSuccess) | 305 DECLARE_CASE(IfSuccess) |
| 307 DECLARE_CASE(Switch) | 306 DECLARE_CASE(Switch) |
| 308 DECLARE_CASE(IfValue) | 307 DECLARE_CASE(IfValue) |
| 309 DECLARE_CASE(IfDefault) | 308 DECLARE_CASE(IfDefault) |
| 310 DECLARE_CASE(Merge) | 309 DECLARE_CASE(Merge) |
| 311 DECLARE_CASE(Deoptimize) | 310 DECLARE_CASE(Deoptimize) |
| 312 DECLARE_CASE(Return) | 311 DECLARE_CASE(Return) |
| 313 DECLARE_CASE(TailCall) | 312 DECLARE_CASE(TailCall) |
| 314 DECLARE_CASE(Terminate) | 313 DECLARE_CASE(Terminate) |
| 315 DECLARE_CASE(OsrNormalEntry) | 314 DECLARE_CASE(OsrNormalEntry) |
| 316 DECLARE_CASE(OsrLoopEntry) | 315 DECLARE_CASE(OsrLoopEntry) |
| 316 DECLARE_CASE(DeadControl) |
| 317 DECLARE_CASE(Throw) | 317 DECLARE_CASE(Throw) |
| 318 DECLARE_CASE(End) | 318 DECLARE_CASE(End) |
| 319 #undef DECLARE_CASE | 319 #undef DECLARE_CASE |
| 320 break; | 320 break; |
| 321 } | 321 } |
| 322 UNREACHABLE(); | 322 UNREACHABLE(); |
| 323 return Bounds(); | 323 return Bounds(); |
| 324 } | 324 } |
| 325 | 325 |
| 326 Type* TypeConstant(Handle<Object> value); | 326 Type* TypeConstant(Handle<Object> value); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 UNREACHABLE(); | 735 UNREACHABLE(); |
| 736 return Bounds(); | 736 return Bounds(); |
| 737 } | 737 } |
| 738 | 738 |
| 739 | 739 |
| 740 Bounds Typer::Visitor::TypeFinish(Node* node) { | 740 Bounds Typer::Visitor::TypeFinish(Node* node) { |
| 741 return Operand(node, 0); | 741 return Operand(node, 0); |
| 742 } | 742 } |
| 743 | 743 |
| 744 | 744 |
| 745 Bounds Typer::Visitor::TypeDeadValue(Node* node) { |
| 746 return Bounds(Type::None(zone()), Type::Any(zone())); |
| 747 } |
| 748 |
| 749 |
| 750 Bounds Typer::Visitor::TypeDeadEffect(Node* node) { |
| 751 UNREACHABLE(); |
| 752 return Bounds(); |
| 753 } |
| 754 |
| 755 |
| 745 Bounds Typer::Visitor::TypeFrameState(Node* node) { | 756 Bounds Typer::Visitor::TypeFrameState(Node* node) { |
| 746 // TODO(rossberg): Ideally FrameState wouldn't have a value output. | 757 // TODO(rossberg): Ideally FrameState wouldn't have a value output. |
| 747 return Bounds(Type::None(zone()), Type::Internal(zone())); | 758 return Bounds(Type::None(zone()), Type::Internal(zone())); |
| 748 } | 759 } |
| 749 | 760 |
| 750 | 761 |
| 751 Bounds Typer::Visitor::TypeStateValues(Node* node) { | 762 Bounds Typer::Visitor::TypeStateValues(Node* node) { |
| 752 return Bounds(Type::None(zone()), Type::Internal(zone())); | 763 return Bounds(Type::None(zone()), Type::Internal(zone())); |
| 753 } | 764 } |
| 754 | 765 |
| (...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 2429 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
| 2419 #undef TYPED_ARRAY_CASE | 2430 #undef TYPED_ARRAY_CASE |
| 2420 } | 2431 } |
| 2421 } | 2432 } |
| 2422 return Type::Constant(value, zone()); | 2433 return Type::Constant(value, zone()); |
| 2423 } | 2434 } |
| 2424 | 2435 |
| 2425 } // namespace compiler | 2436 } // namespace compiler |
| 2426 } // namespace internal | 2437 } // namespace internal |
| 2427 } // namespace v8 | 2438 } // namespace v8 |
| OLD | NEW |