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 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 // TODO(turbofan): Add support for NewTarget passed to JSCreate. | 1410 // TODO(turbofan): Add support for NewTarget passed to JSCreate. |
1411 if (target != new_target) return NoChange(); | 1411 if (target != new_target) return NoChange(); |
1412 // Extract constructor function. | 1412 // Extract constructor function. |
1413 if (target_type->IsConstant() && | 1413 if (target_type->IsConstant() && |
1414 target_type->AsConstant()->Value()->IsJSFunction()) { | 1414 target_type->AsConstant()->Value()->IsJSFunction()) { |
1415 Handle<JSFunction> constructor = | 1415 Handle<JSFunction> constructor = |
1416 Handle<JSFunction>::cast(target_type->AsConstant()->Value()); | 1416 Handle<JSFunction>::cast(target_type->AsConstant()->Value()); |
1417 DCHECK(constructor->IsConstructor()); | 1417 DCHECK(constructor->IsConstructor()); |
1418 // Force completion of inobject slack tracking before | 1418 // Force completion of inobject slack tracking before |
1419 // generating code to finalize the instance size. | 1419 // generating code to finalize the instance size. |
1420 if (constructor->IsInobjectSlackTrackingInProgress()) { | 1420 constructor->CompleteInobjectSlackTrackingIfActive(); |
1421 constructor->CompleteInobjectSlackTracking(); | |
1422 } | |
1423 | 1421 |
1424 // TODO(bmeurer): We fall back to the runtime in case we cannot inline | 1422 // TODO(bmeurer): We fall back to the runtime in case we cannot inline |
1425 // the allocation here, which is sort of expensive. We should think about | 1423 // the allocation here, which is sort of expensive. We should think about |
1426 // a soft fallback to some NewObjectCodeStub. | 1424 // a soft fallback to some NewObjectCodeStub. |
1427 if (IsAllocationInlineable(constructor)) { | 1425 if (IsAllocationInlineable(constructor)) { |
1428 // Compute instance size from initial map of {constructor}. | 1426 // Compute instance size from initial map of {constructor}. |
1429 Handle<Map> initial_map(constructor->initial_map(), isolate()); | 1427 Handle<Map> initial_map(constructor->initial_map(), isolate()); |
1430 int const instance_size = initial_map->instance_size(); | 1428 int const instance_size = initial_map->instance_size(); |
1431 | 1429 |
1432 // Add a dependency on the {initial_map} to make sure that this code is | 1430 // Add a dependency on the {initial_map} to make sure that this code is |
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2598 } | 2596 } |
2599 | 2597 |
2600 | 2598 |
2601 CompilationDependencies* JSTypedLowering::dependencies() const { | 2599 CompilationDependencies* JSTypedLowering::dependencies() const { |
2602 return dependencies_; | 2600 return dependencies_; |
2603 } | 2601 } |
2604 | 2602 |
2605 } // namespace compiler | 2603 } // namespace compiler |
2606 } // namespace internal | 2604 } // namespace internal |
2607 } // namespace v8 | 2605 } // namespace v8 |
OLD | NEW |