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

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

Issue 2153433002: [Interpreter] Collect type feedback for 'new' in the bytecode handler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added a TODO as suggested by Benedikt. Created 4 years, 5 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/compiler/bytecode-branch-analysis.h" 7 #include "src/compiler/bytecode-branch-analysis.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/operator-properties.h" 9 #include "src/compiler/operator-properties.h"
10 #include "src/interpreter/bytecodes.h" 10 #include "src/interpreter/bytecodes.h"
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 } 1056 }
1057 1057
1058 void BytecodeGraphBuilder::VisitNew() { 1058 void BytecodeGraphBuilder::VisitNew() {
1059 FrameStateBeforeAndAfter states(this); 1059 FrameStateBeforeAndAfter states(this);
1060 interpreter::Register callee_reg = bytecode_iterator().GetRegisterOperand(0); 1060 interpreter::Register callee_reg = bytecode_iterator().GetRegisterOperand(0);
1061 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); 1061 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1);
1062 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); 1062 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
1063 1063
1064 Node* new_target = environment()->LookupAccumulator(); 1064 Node* new_target = environment()->LookupAccumulator();
1065 Node* callee = environment()->LookupRegister(callee_reg); 1065 Node* callee = environment()->LookupRegister(callee_reg);
1066 // TODO(turbofan): Pass the feedback here. 1066
1067 const Operator* call = javascript()->CallConstruct( 1067 // Slot index of 0 is used indicate no feedback slot is available. Assert
1068 static_cast<int>(arg_count) + 2, VectorSlotPair()); 1068 // the assumption that slot index 0 is never a valid feedback slot.
1069 STATIC_ASSERT(TypeFeedbackVector::kReservedIndexCount > 0);
1070 VectorSlotPair feedback =
1071 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3));
rmcilroy 2016/07/18 10:13:01 nit - could you move this to the top where other o
mythria 2016/07/19 09:50:59 Done.
1072
1073 const Operator* call =
1074 javascript()->CallConstruct(static_cast<int>(arg_count) + 2, feedback);
1069 Node* value = ProcessCallNewArguments(call, callee, new_target, first_arg, 1075 Node* value = ProcessCallNewArguments(call, callee, new_target, first_arg,
1070 arg_count + 2); 1076 arg_count + 2);
1071 environment()->BindAccumulator(value, &states); 1077 environment()->BindAccumulator(value, &states);
1072 } 1078 }
1073 1079
1074 void BytecodeGraphBuilder::BuildThrow() { 1080 void BytecodeGraphBuilder::BuildThrow() {
1075 FrameStateBeforeAndAfter states(this); 1081 FrameStateBeforeAndAfter states(this);
1076 Node* value = environment()->LookupAccumulator(); 1082 Node* value = environment()->LookupAccumulator();
1077 Node* call = NewNode(javascript()->CallRuntime(Runtime::kThrow), value); 1083 Node* call = NewNode(javascript()->CallRuntime(Runtime::kThrow), value);
1078 environment()->BindAccumulator(call, &states); 1084 environment()->BindAccumulator(call, &states);
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1784 // Phi does not exist yet, introduce one. 1790 // Phi does not exist yet, introduce one.
1785 value = NewPhi(inputs, value, control); 1791 value = NewPhi(inputs, value, control);
1786 value->ReplaceInput(inputs - 1, other); 1792 value->ReplaceInput(inputs - 1, other);
1787 } 1793 }
1788 return value; 1794 return value;
1789 } 1795 }
1790 1796
1791 } // namespace compiler 1797 } // namespace compiler
1792 } // namespace internal 1798 } // namespace internal
1793 } // namespace v8 1799 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698