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

Unified Diff: src/compiler/js-typed-lowering.cc

Issue 1404293002: [turbofan] Remove the --turbo-allocate flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index 95e22082ea25bf92188cd53e0d2f92451fd80493..815e372b3faeb3138241b31947793d38458e73aa 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -1256,13 +1256,18 @@ Reduction JSTypedLowering::ReduceJSCreateLiteralObject(Node* node) {
Reduction JSTypedLowering::ReduceJSCreateFunctionContext(Node* node) {
DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, node->opcode());
int slot_count = OpParameter<int>(node->op());
+ Node* const closure = NodeProperties::GetValueInput(node, 0);
+
+ // The closure can be NumberConstant(0) if the closure is global code
+ // (rather than a function). We exclude that case here.
+ // TODO(jarin) Find a better way to check that the closure is a function.
// Use inline allocation for function contexts up to a size limit.
- if (FLAG_turbo_allocate && slot_count < kFunctionContextAllocationLimit) {
+ if (slot_count < kFunctionContextAllocationLimit &&
+ closure->opcode() != IrOpcode::kNumberConstant) {
// JSCreateFunctionContext[slot_count < limit]](fun)
Node* const effect = NodeProperties::GetEffectInput(node);
Node* const control = NodeProperties::GetControlInput(node);
- Node* const closure = NodeProperties::GetValueInput(node, 0);
Node* const context = NodeProperties::GetContextInput(node);
Node* const extension = jsgraph()->ZeroConstant();
Node* const load = graph()->NewNode(
@@ -1278,7 +1283,7 @@ Reduction JSTypedLowering::ReduceJSCreateFunctionContext(Node* node) {
a.Store(AccessBuilder::ForContextSlot(Context::EXTENSION_INDEX), extension);
a.Store(AccessBuilder::ForContextSlot(Context::GLOBAL_OBJECT_INDEX), load);
for (int i = Context::MIN_CONTEXT_SLOTS; i < context_length; ++i) {
- a.Store(AccessBuilder::ForContextSlot(i), jsgraph()->TheHoleConstant());
+ a.Store(AccessBuilder::ForContextSlot(i), jsgraph()->UndefinedConstant());
}
RelaxControls(node);
a.Finish(node);
@@ -1306,14 +1311,19 @@ Reduction JSTypedLowering::ReduceJSCreateFunctionContext(Node* node) {
Reduction JSTypedLowering::ReduceJSCreateWithContext(Node* node) {
DCHECK_EQ(IrOpcode::kJSCreateWithContext, node->opcode());
Node* const input = NodeProperties::GetValueInput(node, 0);
+ Node* const closure = NodeProperties::GetValueInput(node, 1);
Type* input_type = NodeProperties::GetType(input);
+ // The closure can be NumberConstant(0) if the closure is global code
+ // (rather than a function). We exclude that case here.
+ // TODO(jarin) Find a better way to check that the closure is a function.
+
// Use inline allocation for with contexts for regular objects.
- if (FLAG_turbo_allocate && input_type->Is(Type::Receiver())) {
+ if (input_type->Is(Type::Receiver()) &&
+ closure->opcode() != IrOpcode::kNumberConstant) {
// JSCreateWithContext(o:receiver, fun)
Node* const effect = NodeProperties::GetEffectInput(node);
Node* const control = NodeProperties::GetControlInput(node);
- Node* const closure = NodeProperties::GetValueInput(node, 1);
Node* const context = NodeProperties::GetContextInput(node);
Node* const load = graph()->NewNode(
simplified()->LoadField(
@@ -1339,13 +1349,18 @@ Reduction JSTypedLowering::ReduceJSCreateBlockContext(Node* node) {
DCHECK_EQ(IrOpcode::kJSCreateBlockContext, node->opcode());
Handle<ScopeInfo> scope_info = OpParameter<Handle<ScopeInfo>>(node);
int context_length = scope_info->ContextLength();
+ Node* const closure = NodeProperties::GetValueInput(node, 0);
+
+ // The closure can be NumberConstant(0) if the closure is global code
+ // (rather than a function). We exclude that case here.
+ // TODO(jarin) Find a better way to check that the closure is a function.
// Use inline allocation for block contexts up to a size limit.
- if (FLAG_turbo_allocate && context_length < kBlockContextAllocationLimit) {
+ if (context_length < kBlockContextAllocationLimit &&
+ closure->opcode() != IrOpcode::kNumberConstant) {
// JSCreateBlockContext[scope[length < limit]](fun)
Node* const effect = NodeProperties::GetEffectInput(node);
Node* const control = NodeProperties::GetControlInput(node);
- Node* const closure = NodeProperties::GetValueInput(node, 1);
Node* const context = NodeProperties::GetContextInput(node);
Node* const extension = jsgraph()->Constant(scope_info);
Node* const load = graph()->NewNode(
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698