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

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 2646763003: [turbofan] Optimize typeof o === "object" checks. (Closed)
Patch Set: Address comment. Created 3 years, 11 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
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/js-typed-lowering.h" 5 #include "src/compiler/js-typed-lowering.h"
6 6
7 #include "src/ast/modules.h" 7 #include "src/ast/modules.h"
8 #include "src/builtins/builtins-utils.h" 8 #include "src/builtins/builtins-utils.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compilation-dependencies.h" 10 #include "src/compilation-dependencies.h"
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 graph()->NewNode(common()->Select(MachineRepresentation::kTagged), 896 graph()->NewNode(common()->Select(MachineRepresentation::kTagged),
897 graph()->NewNode(simplified()->ReferenceEqual(), input, 897 graph()->NewNode(simplified()->ReferenceEqual(), input,
898 jsgraph()->TrueConstant()), 898 jsgraph()->TrueConstant()),
899 jsgraph()->TrueConstant(), 899 jsgraph()->TrueConstant(),
900 graph()->NewNode(simplified()->ReferenceEqual(), input, 900 graph()->NewNode(simplified()->ReferenceEqual(), input,
901 jsgraph()->FalseConstant())); 901 jsgraph()->FalseConstant()));
902 } else if (String::Equals(type, factory()->function_string())) { 902 } else if (String::Equals(type, factory()->function_string())) {
903 value = graph()->NewNode(simplified()->ObjectIsCallable(), input); 903 value = graph()->NewNode(simplified()->ObjectIsCallable(), input);
904 } else if (String::Equals(type, factory()->number_string())) { 904 } else if (String::Equals(type, factory()->number_string())) {
905 value = graph()->NewNode(simplified()->ObjectIsNumber(), input); 905 value = graph()->NewNode(simplified()->ObjectIsNumber(), input);
906 } else if (String::Equals(type, factory()->object_string())) {
907 value = graph()->NewNode(
908 common()->Select(MachineRepresentation::kTagged),
909 graph()->NewNode(simplified()->ObjectIsNonCallable(), input),
910 jsgraph()->TrueConstant(),
911 graph()->NewNode(simplified()->ReferenceEqual(), input,
912 jsgraph()->NullConstant()));
906 } else if (String::Equals(type, factory()->string_string())) { 913 } else if (String::Equals(type, factory()->string_string())) {
907 value = graph()->NewNode(simplified()->ObjectIsString(), input); 914 value = graph()->NewNode(simplified()->ObjectIsString(), input);
908 } else if (String::Equals(type, factory()->undefined_string())) { 915 } else if (String::Equals(type, factory()->undefined_string())) {
909 value = graph()->NewNode( 916 value = graph()->NewNode(
910 common()->Select(MachineRepresentation::kTagged), 917 common()->Select(MachineRepresentation::kTagged),
911 graph()->NewNode(simplified()->ReferenceEqual(), input, 918 graph()->NewNode(simplified()->ReferenceEqual(), input,
912 jsgraph()->NullConstant()), 919 jsgraph()->NullConstant()),
913 jsgraph()->FalseConstant(), 920 jsgraph()->FalseConstant(),
914 graph()->NewNode(simplified()->ObjectIsUndetectable(), input)); 921 graph()->NewNode(simplified()->ObjectIsUndetectable(), input));
915 } else { 922 } else {
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 } 2430 }
2424 2431
2425 2432
2426 CompilationDependencies* JSTypedLowering::dependencies() const { 2433 CompilationDependencies* JSTypedLowering::dependencies() const {
2427 return dependencies_; 2434 return dependencies_;
2428 } 2435 }
2429 2436
2430 } // namespace compiler 2437 } // namespace compiler
2431 } // namespace internal 2438 } // namespace internal
2432 } // namespace v8 2439 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698