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

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

Issue 1475383002: [compiler] Always pass closure argument to with, catch and block context creation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove WithExpression from messages.h Created 5 years, 1 month 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 | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('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 f864f40edb4cfb325ee7797e7de3dfce049e1aba..e0eac28b47d0e7c7490653fd1fc69e29db77bf7d 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -1838,13 +1838,8 @@ Reduction JSTypedLowering::ReduceJSCreateFunctionContext(Node* node) {
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 (slot_count < kFunctionContextAllocationLimit &&
- closure->opcode() != IrOpcode::kNumberConstant) {
+ if (slot_count < kFunctionContextAllocationLimit) {
// JSCreateFunctionContext[slot_count < limit]](fun)
Node* const effect = NodeProperties::GetEffectInput(node);
Node* const control = NodeProperties::GetControlInput(node);
@@ -1892,15 +1887,10 @@ 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.
+ Type* const input_type = NodeProperties::GetType(input);
// Use inline allocation for with contexts for regular objects.
- if (input_type->Is(Type::Receiver()) &&
- closure->opcode() != IrOpcode::kNumberConstant) {
+ if (input_type->Is(Type::Receiver())) {
// JSCreateWithContext(o:receiver, fun)
Node* const effect = NodeProperties::GetEffectInput(node);
Node* const control = NodeProperties::GetControlInput(node);
@@ -1931,13 +1921,8 @@ Reduction JSTypedLowering::ReduceJSCreateBlockContext(Node* 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 (context_length < kBlockContextAllocationLimit &&
- closure->opcode() != IrOpcode::kNumberConstant) {
+ if (context_length < kBlockContextAllocationLimit) {
// JSCreateBlockContext[scope[length < limit]](fun)
Node* const effect = NodeProperties::GetEffectInput(node);
Node* const control = NodeProperties::GetControlInput(node);
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698