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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compilation-dependencies.h" | 6 #include "src/compilation-dependencies.h" |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 | 1113 |
1114 JSBinopReduction r(this, node); | 1114 JSBinopReduction r(this, node); |
1115 Node* effect = r.effect(); | 1115 Node* effect = r.effect(); |
1116 Node* control = r.control(); | 1116 Node* control = r.control(); |
1117 | 1117 |
1118 if (r.right_type()->IsConstant() && | 1118 if (r.right_type()->IsConstant() && |
1119 r.right_type()->AsConstant()->Value()->IsJSFunction()) { | 1119 r.right_type()->AsConstant()->Value()->IsJSFunction()) { |
1120 Handle<JSFunction> function = | 1120 Handle<JSFunction> function = |
1121 Handle<JSFunction>::cast(r.right_type()->AsConstant()->Value()); | 1121 Handle<JSFunction>::cast(r.right_type()->AsConstant()->Value()); |
1122 Handle<SharedFunctionInfo> shared(function->shared(), isolate()); | 1122 Handle<SharedFunctionInfo> shared(function->shared(), isolate()); |
1123 if (!function->map()->has_non_instance_prototype()) { | 1123 if (function->IsConstructor() && |
| 1124 !function->map()->has_non_instance_prototype()) { |
1124 JSFunction::EnsureHasInitialMap(function); | 1125 JSFunction::EnsureHasInitialMap(function); |
1125 DCHECK(function->has_initial_map()); | 1126 DCHECK(function->has_initial_map()); |
1126 Handle<Map> initial_map(function->initial_map(), isolate()); | 1127 Handle<Map> initial_map(function->initial_map(), isolate()); |
1127 this->dependencies()->AssumeInitialMapCantChange(initial_map); | 1128 this->dependencies()->AssumeInitialMapCantChange(initial_map); |
1128 Node* prototype = | 1129 Node* prototype = |
1129 jsgraph()->Constant(handle(initial_map->prototype(), isolate())); | 1130 jsgraph()->Constant(handle(initial_map->prototype(), isolate())); |
1130 | 1131 |
1131 Node* if_is_smi = nullptr; | 1132 Node* if_is_smi = nullptr; |
1132 Node* e_is_smi = nullptr; | 1133 Node* e_is_smi = nullptr; |
1133 // If the left hand side is an object, no smi check is needed. | 1134 // If the left hand side is an object, no smi check is needed. |
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2568 } | 2569 } |
2569 | 2570 |
2570 | 2571 |
2571 CompilationDependencies* JSTypedLowering::dependencies() const { | 2572 CompilationDependencies* JSTypedLowering::dependencies() const { |
2572 return dependencies_; | 2573 return dependencies_; |
2573 } | 2574 } |
2574 | 2575 |
2575 } // namespace compiler | 2576 } // namespace compiler |
2576 } // namespace internal | 2577 } // namespace internal |
2577 } // namespace v8 | 2578 } // namespace v8 |
OLD | NEW |