| 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/compiler/graph-inl.h" | 5 #include "src/compiler/graph-inl.h" |
| 6 #include "src/compiler/js-operator.h" | 6 #include "src/compiler/js-operator.h" |
| 7 #include "src/compiler/node.h" | 7 #include "src/compiler/node.h" |
| 8 #include "src/compiler/node-properties-inl.h" | 8 #include "src/compiler/node-properties-inl.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 #include "src/compiler/simplified-operator.h" | 10 #include "src/compiler/simplified-operator.h" |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 | 478 |
| 479 | 479 |
| 480 Bounds Typer::Visitor::TypeJSInstanceOf(Node* node) { | 480 Bounds Typer::Visitor::TypeJSInstanceOf(Node* node) { |
| 481 return Bounds(Type::Boolean(zone())); | 481 return Bounds(Type::Boolean(zone())); |
| 482 } | 482 } |
| 483 | 483 |
| 484 | 484 |
| 485 // JS context operators. | 485 // JS context operators. |
| 486 | 486 |
| 487 Bounds Typer::Visitor::TypeJSLoadContext(Node* node) { | 487 Bounds Typer::Visitor::TypeJSLoadContext(Node* node) { |
| 488 // TODO(rossberg): Fix this once we actually use the lower bound anywhere. |
| 489 #if 0 |
| 488 Bounds outer = OperandType(node, 0); | 490 Bounds outer = OperandType(node, 0); |
| 489 DCHECK(outer.upper->Maybe(Type::Internal())); | 491 DCHECK(outer.upper->Maybe(Type::Internal())); |
| 490 // TODO(rossberg): More precisely, instead of the above assertion, we should | 492 // TODO(rossberg): More precisely, instead of the above assertion, we should |
| 491 // back-propagate the constraint that it has to be a subtype of Internal. | 493 // back-propagate the constraint that it has to be a subtype of Internal. |
| 492 | 494 |
| 493 ContextAccess access = OpParameter<ContextAccess>(node); | 495 ContextAccess access = OpParameter<ContextAccess>(node); |
| 494 Type* context_type = outer.upper; | 496 Type* context_type = outer.upper; |
| 495 MaybeHandle<Context> context; | 497 MaybeHandle<Context> context; |
| 496 if (context_type->IsConstant()) { | 498 if (context_type->IsConstant()) { |
| 497 context = Handle<Context>::cast(context_type->AsConstant()->Value()); | 499 context = Handle<Context>::cast(context_type->AsConstant()->Value()); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 512 } | 514 } |
| 513 } | 515 } |
| 514 if (context.is_null()) { | 516 if (context.is_null()) { |
| 515 return Bounds::Unbounded(zone()); | 517 return Bounds::Unbounded(zone()); |
| 516 } else { | 518 } else { |
| 517 Handle<Object> value = | 519 Handle<Object> value = |
| 518 handle(context.ToHandleChecked()->get(access.index()), isolate()); | 520 handle(context.ToHandleChecked()->get(access.index()), isolate()); |
| 519 Type* lower = TypeConstant(value); | 521 Type* lower = TypeConstant(value); |
| 520 return Bounds(lower, Type::Any(zone())); | 522 return Bounds(lower, Type::Any(zone())); |
| 521 } | 523 } |
| 524 #else |
| 525 return Bounds::Unbounded(zone()); |
| 526 #endif |
| 522 } | 527 } |
| 523 | 528 |
| 524 | 529 |
| 525 Bounds Typer::Visitor::TypeJSStoreContext(Node* node) { | 530 Bounds Typer::Visitor::TypeJSStoreContext(Node* node) { |
| 526 return Bounds(Type::None(zone())); | 531 return Bounds(Type::None(zone())); |
| 527 } | 532 } |
| 528 | 533 |
| 529 | 534 |
| 530 Bounds Typer::Visitor::TypeJSCreateFunctionContext(Node* node) { | 535 Bounds Typer::Visitor::TypeJSCreateFunctionContext(Node* node) { |
| 531 Type* outer = ContextType(node); | 536 Type* outer = ContextType(node); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 } | 846 } |
| 842 | 847 |
| 843 | 848 |
| 844 void Typer::DecorateGraph(Graph* graph) { | 849 void Typer::DecorateGraph(Graph* graph) { |
| 845 graph->AddDecorator(new (zone()) TyperDecorator(this)); | 850 graph->AddDecorator(new (zone()) TyperDecorator(this)); |
| 846 } | 851 } |
| 847 | 852 |
| 848 } | 853 } |
| 849 } | 854 } |
| 850 } // namespace v8::internal::compiler | 855 } // namespace v8::internal::compiler |
| OLD | NEW |