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

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

Issue 1466643002: [turbofan] Initial support for Array constructor specialization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/js-call-reducer.h » ('j') | src/compiler/js-operator.h » ('J')
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/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2523 VisitForValue(expr->expression()); 2523 VisitForValue(expr->expression());
2524 2524
2525 // Evaluate all arguments to the construct call. 2525 // Evaluate all arguments to the construct call.
2526 ZoneList<Expression*>* args = expr->arguments(); 2526 ZoneList<Expression*>* args = expr->arguments();
2527 VisitForValues(args); 2527 VisitForValues(args);
2528 2528
2529 // The new target is the same as the callee. 2529 // The new target is the same as the callee.
2530 environment()->Push(environment()->Peek(args->length())); 2530 environment()->Push(environment()->Peek(args->length()));
2531 2531
2532 // Create node to perform the construct call. 2532 // Create node to perform the construct call.
2533 const Operator* call = javascript()->CallConstruct(args->length() + 2); 2533 VectorSlotPair feedback = CreateVectorSlotPair(expr->CallNewFeedbackSlot());
2534 const Operator* call =
2535 javascript()->CallConstruct(args->length() + 2, feedback);
2534 Node* value = ProcessArguments(call, args->length() + 2); 2536 Node* value = ProcessArguments(call, args->length() + 2);
2535 PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine()); 2537 PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
2536 ast_context()->ProduceValue(value); 2538 ast_context()->ProduceValue(value);
2537 } 2539 }
2538 2540
2539 2541
2540 void AstGraphBuilder::VisitCallJSRuntime(CallRuntime* expr) { 2542 void AstGraphBuilder::VisitCallJSRuntime(CallRuntime* expr) {
2541 // The callee and the receiver both have to be pushed onto the operand stack 2543 // The callee and the receiver both have to be pushed onto the operand stack
2542 // before arguments are being evaluated. 2544 // before arguments are being evaluated.
2543 Node* callee_value = BuildLoadNativeContextField(expr->context_index()); 2545 Node* callee_value = BuildLoadNativeContextField(expr->context_index());
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
3645 3647
3646 Node* AstGraphBuilder::BuildLoadGlobalObject() { 3648 Node* AstGraphBuilder::BuildLoadGlobalObject() {
3647 const Operator* load_op = 3649 const Operator* load_op =
3648 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true); 3650 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true);
3649 return NewNode(load_op, GetFunctionContext()); 3651 return NewNode(load_op, GetFunctionContext());
3650 } 3652 }
3651 3653
3652 3654
3653 Node* AstGraphBuilder::BuildLoadNativeContextField(int index) { 3655 Node* AstGraphBuilder::BuildLoadNativeContextField(int index) {
3654 Node* global = BuildLoadGlobalObject(); 3656 Node* global = BuildLoadGlobalObject();
3655 Node* native_context = 3657 Node* native_context = NewNode(javascript()->LoadNativeContext(), global);
3656 BuildLoadObjectField(global, JSGlobalObject::kNativeContextOffset);
3657 return NewNode(javascript()->LoadContext(0, index, true), native_context); 3658 return NewNode(javascript()->LoadContext(0, index, true), native_context);
3658 } 3659 }
3659 3660
3660 3661
3661 Node* AstGraphBuilder::BuildLoadFeedbackVector() { 3662 Node* AstGraphBuilder::BuildLoadFeedbackVector() {
3662 if (!feedback_vector_.is_set()) { 3663 if (!feedback_vector_.is_set()) {
3663 Node* closure = GetFunctionClosure(); 3664 Node* closure = GetFunctionClosure();
3664 Node* shared = BuildLoadImmutableObjectField( 3665 Node* shared = BuildLoadImmutableObjectField(
3665 closure, JSFunction::kSharedFunctionInfoOffset); 3666 closure, JSFunction::kSharedFunctionInfoOffset);
3666 Node* vector = BuildLoadImmutableObjectField( 3667 Node* vector = BuildLoadImmutableObjectField(
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
4301 // Phi does not exist yet, introduce one. 4302 // Phi does not exist yet, introduce one.
4302 value = NewPhi(inputs, value, control); 4303 value = NewPhi(inputs, value, control);
4303 value->ReplaceInput(inputs - 1, other); 4304 value->ReplaceInput(inputs - 1, other);
4304 } 4305 }
4305 return value; 4306 return value;
4306 } 4307 }
4307 4308
4308 } // namespace compiler 4309 } // namespace compiler
4309 } // namespace internal 4310 } // namespace internal
4310 } // namespace v8 4311 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/js-call-reducer.h » ('j') | src/compiler/js-operator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698