Chromium Code Reviews| 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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1404 | 1404 |
| 1405 | 1405 |
| 1406 namespace { | 1406 namespace { |
| 1407 | 1407 |
| 1408 // Maximum instance size for which allocations will be inlined. | 1408 // Maximum instance size for which allocations will be inlined. |
| 1409 const int kMaxInlineInstanceSize = 64 * kPointerSize; | 1409 const int kMaxInlineInstanceSize = 64 * kPointerSize; |
| 1410 | 1410 |
| 1411 | 1411 |
| 1412 // Checks whether allocation using the given constructor can be inlined. | 1412 // Checks whether allocation using the given constructor can be inlined. |
| 1413 bool IsAllocationInlineable(Handle<JSFunction> constructor) { | 1413 bool IsAllocationInlineable(Handle<JSFunction> constructor) { |
| 1414 // TODO(bmeurer): Support inlining of class constructors. | 1414 // TODO(bmeurer): Further relax restrictions on inlining, i.e. |
| 1415 if (IsClassConstructor(constructor->shared()->kind())) return false; | 1415 // instance type and maybe instance size (inobject properties |
| 1416 // are limited anyways by the runtime). | |
|
Toon Verwaest
2015/12/16 20:00:47
DBC: Don't you only want to allow it for base clas
Benedikt Meurer
2015/12/16 20:29:07
You already answered the question. I'm currently w
| |
| 1416 return constructor->has_initial_map() && | 1417 return constructor->has_initial_map() && |
| 1417 constructor->initial_map()->instance_type() == JS_OBJECT_TYPE && | 1418 constructor->initial_map()->instance_type() == JS_OBJECT_TYPE && |
| 1418 constructor->initial_map()->instance_size() < kMaxInlineInstanceSize; | 1419 constructor->initial_map()->instance_size() < kMaxInlineInstanceSize; |
| 1419 } | 1420 } |
| 1420 | 1421 |
| 1421 } // namespace | 1422 } // namespace |
| 1422 | 1423 |
| 1423 | 1424 |
| 1424 Reduction JSTypedLowering::ReduceJSCreate(Node* node) { | 1425 Reduction JSTypedLowering::ReduceJSCreate(Node* node) { |
| 1425 DCHECK_EQ(IrOpcode::kJSCreate, node->opcode()); | 1426 DCHECK_EQ(IrOpcode::kJSCreate, node->opcode()); |
| (...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2749 } | 2750 } |
| 2750 | 2751 |
| 2751 | 2752 |
| 2752 CompilationDependencies* JSTypedLowering::dependencies() const { | 2753 CompilationDependencies* JSTypedLowering::dependencies() const { |
| 2753 return dependencies_; | 2754 return dependencies_; |
| 2754 } | 2755 } |
| 2755 | 2756 |
| 2756 } // namespace compiler | 2757 } // namespace compiler |
| 2757 } // namespace internal | 2758 } // namespace internal |
| 2758 } // namespace v8 | 2759 } // namespace v8 |
| OLD | NEW |