Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: src/compiler/typer.cc

Issue 613683002: [turbofan] Some javascript operators are globally shared singletons. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/operator-properties-inl.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 Type* context_type = outer.upper; 550 Type* context_type = outer.upper;
551 MaybeHandle<Context> context; 551 MaybeHandle<Context> context;
552 if (context_type->IsConstant()) { 552 if (context_type->IsConstant()) {
553 context = Handle<Context>::cast(context_type->AsConstant()->Value()); 553 context = Handle<Context>::cast(context_type->AsConstant()->Value());
554 } 554 }
555 // Walk context chain (as far as known), mirroring dynamic lookup. 555 // Walk context chain (as far as known), mirroring dynamic lookup.
556 // Since contexts are mutable, the information is only useful as a lower 556 // Since contexts are mutable, the information is only useful as a lower
557 // bound. 557 // bound.
558 // TODO(rossberg): Could use scope info to fix upper bounds for constant 558 // TODO(rossberg): Could use scope info to fix upper bounds for constant
559 // bindings if we know that this code is never shared. 559 // bindings if we know that this code is never shared.
560 for (int i = access.depth(); i > 0; --i) { 560 for (size_t i = access.depth(); i > 0; --i) {
561 if (context_type->IsContext()) { 561 if (context_type->IsContext()) {
562 context_type = context_type->AsContext()->Outer(); 562 context_type = context_type->AsContext()->Outer();
563 if (context_type->IsConstant()) { 563 if (context_type->IsConstant()) {
564 context = Handle<Context>::cast(context_type->AsConstant()->Value()); 564 context = Handle<Context>::cast(context_type->AsConstant()->Value());
565 } 565 }
566 } else if (!context.is_null()) { 566 } else if (!context.is_null()) {
567 context = handle(context.ToHandleChecked()->previous(), isolate()); 567 context = handle(context.ToHandleChecked()->previous(), isolate());
568 } 568 }
569 } 569 }
570 if (context.is_null()) { 570 if (context.is_null()) {
571 return Bounds::Unbounded(zone()); 571 return Bounds::Unbounded(zone());
572 } else { 572 } else {
573 Handle<Object> value = 573 Handle<Object> value =
574 handle(context.ToHandleChecked()->get(access.index()), isolate()); 574 handle(context.ToHandleChecked()->get(static_cast<int>(access.index())),
575 isolate());
575 Type* lower = TypeConstant(value); 576 Type* lower = TypeConstant(value);
576 return Bounds(lower, Type::Any(zone())); 577 return Bounds(lower, Type::Any(zone()));
577 } 578 }
578 } 579 }
579 580
580 581
581 Bounds Typer::Visitor::TypeJSStoreContext(Node* node) { 582 Bounds Typer::Visitor::TypeJSStoreContext(Node* node) {
582 UNREACHABLE(); 583 UNREACHABLE();
583 return Bounds(); 584 return Bounds();
584 } 585 }
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 } 906 }
906 907
907 908
908 void Typer::DecorateGraph(Graph* graph) { 909 void Typer::DecorateGraph(Graph* graph) {
909 graph->AddDecorator(new (zone()) TyperDecorator(this)); 910 graph->AddDecorator(new (zone()) TyperDecorator(this));
910 } 911 }
911 912
912 } 913 }
913 } 914 }
914 } // namespace v8::internal::compiler 915 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « src/compiler/operator-properties-inl.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698