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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1537683002: Partial revert of rest parameter desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test failures. Created 4 years, 12 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 unified diff | Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/ast-loop-assignment-analyzer.h" 9 #include "src/compiler/ast-loop-assignment-analyzer.h"
10 #include "src/compiler/control-builders.h" 10 #include "src/compiler/control-builders.h"
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 return !HasStackOverflow(); 569 return !HasStackOverflow();
570 } 570 }
571 571
572 572
573 void AstGraphBuilder::CreateGraphBody(bool stack_check) { 573 void AstGraphBuilder::CreateGraphBody(bool stack_check) {
574 Scope* scope = info()->scope(); 574 Scope* scope = info()->scope();
575 575
576 // Build the arguments object if it is used. 576 // Build the arguments object if it is used.
577 BuildArgumentsObject(scope->arguments()); 577 BuildArgumentsObject(scope->arguments());
578 578
579 // Build rest arguments array if it is used.
580 int rest_index;
581 Variable* rest_parameter = scope->rest_parameter(&rest_index);
582 BuildRestArgumentsArray(rest_parameter, rest_index);
583
579 // Build assignment to {.this_function} variable if it is used. 584 // Build assignment to {.this_function} variable if it is used.
580 BuildThisFunctionVariable(scope->this_function_var()); 585 BuildThisFunctionVariable(scope->this_function_var());
581 586
582 // Build assignment to {new.target} variable if it is used. 587 // Build assignment to {new.target} variable if it is used.
583 BuildNewTargetVariable(scope->new_target_var()); 588 BuildNewTargetVariable(scope->new_target_var());
584 589
585 // Emit tracing call if requested to do so. 590 // Emit tracing call if requested to do so.
586 if (FLAG_trace) { 591 if (FLAG_trace) {
587 NewNode(javascript()->CallRuntime(Runtime::kTraceEnter, 0)); 592 NewNode(javascript()->CallRuntime(Runtime::kTraceEnter, 0));
588 } 593 }
(...skipping 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after
3214 // Assign the object to the {arguments} variable. This should never lazy 3219 // Assign the object to the {arguments} variable. This should never lazy
3215 // deopt, so it is fine to send invalid bailout id. 3220 // deopt, so it is fine to send invalid bailout id.
3216 DCHECK(arguments->IsContextSlot() || arguments->IsStackAllocated()); 3221 DCHECK(arguments->IsContextSlot() || arguments->IsStackAllocated());
3217 FrameStateBeforeAndAfter states(this, BailoutId::None()); 3222 FrameStateBeforeAndAfter states(this, BailoutId::None());
3218 BuildVariableAssignment(arguments, object, Token::ASSIGN, VectorSlotPair(), 3223 BuildVariableAssignment(arguments, object, Token::ASSIGN, VectorSlotPair(),
3219 BailoutId::None(), states); 3224 BailoutId::None(), states);
3220 return object; 3225 return object;
3221 } 3226 }
3222 3227
3223 3228
3229 Node* AstGraphBuilder::BuildRestArgumentsArray(Variable* rest, int index) {
3230 if (rest == NULL) return NULL;
3231
3232 // TODO(mvstanton): Handle rest arguments.
3233 SetStackOverflow();
3234 return jsgraph()->UndefinedConstant();
3235 }
3236
3237
3224 Node* AstGraphBuilder::BuildThisFunctionVariable(Variable* this_function_var) { 3238 Node* AstGraphBuilder::BuildThisFunctionVariable(Variable* this_function_var) {
3225 if (this_function_var == nullptr) return nullptr; 3239 if (this_function_var == nullptr) return nullptr;
3226 3240
3227 // Retrieve the closure we were called with. 3241 // Retrieve the closure we were called with.
3228 Node* this_function = GetFunctionClosure(); 3242 Node* this_function = GetFunctionClosure();
3229 3243
3230 // Assign the object to the {.this_function} variable. This should never lazy 3244 // Assign the object to the {.this_function} variable. This should never lazy
3231 // deopt, so it is fine to send invalid bailout id. 3245 // deopt, so it is fine to send invalid bailout id.
3232 FrameStateBeforeAndAfter states(this, BailoutId::None()); 3246 FrameStateBeforeAndAfter states(this, BailoutId::None());
3233 BuildVariableAssignment(this_function_var, this_function, Token::INIT, 3247 BuildVariableAssignment(this_function_var, this_function, Token::INIT,
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
4332 // Phi does not exist yet, introduce one. 4346 // Phi does not exist yet, introduce one.
4333 value = NewPhi(inputs, value, control); 4347 value = NewPhi(inputs, value, control);
4334 value->ReplaceInput(inputs - 1, other); 4348 value->ReplaceInput(inputs - 1, other);
4335 } 4349 }
4336 return value; 4350 return value;
4337 } 4351 }
4338 4352
4339 } // namespace compiler 4353 } // namespace compiler
4340 } // namespace internal 4354 } // namespace internal
4341 } // namespace v8 4355 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698