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

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

Issue 1468003002: [Interpreter] Add support for cast operators to bytecode graph builder and (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased the patch and removed unused definitions of matcher classes in unittests Created 5 years 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/linkage.h" 7 #include "src/compiler/linkage.h"
8 #include "src/compiler/operator-properties.h" 8 #include "src/compiler/operator-properties.h"
9 #include "src/interpreter/bytecode-array-iterator.h" 9 #include "src/interpreter/bytecode-array-iterator.h"
10 10
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 BuildCompareOp(javascript()->HasProperty(), iterator); 1014 BuildCompareOp(javascript()->HasProperty(), iterator);
1015 } 1015 }
1016 1016
1017 1017
1018 void BytecodeGraphBuilder::VisitTestInstanceOf( 1018 void BytecodeGraphBuilder::VisitTestInstanceOf(
1019 const interpreter::BytecodeArrayIterator& iterator) { 1019 const interpreter::BytecodeArrayIterator& iterator) {
1020 BuildCompareOp(javascript()->InstanceOf(), iterator); 1020 BuildCompareOp(javascript()->InstanceOf(), iterator);
1021 } 1021 }
1022 1022
1023 1023
1024 void BytecodeGraphBuilder::BuildCastOperator(
1025 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) {
1026 Node* node = NewNode(js_op, environment()->LookupAccumulator());
1027 AddEmptyFrameStateInputs(node);
1028 environment()->BindAccumulator(node);
1029 }
1030
1031
1024 void BytecodeGraphBuilder::VisitToBoolean( 1032 void BytecodeGraphBuilder::VisitToBoolean(
1025 const interpreter::BytecodeArrayIterator& iterator) { 1033 const interpreter::BytecodeArrayIterator& iterator) {
1026 UNIMPLEMENTED(); 1034 BuildCastOperator(javascript()->ToBoolean(), iterator);
1027 } 1035 }
1028 1036
1029 1037
1030 void BytecodeGraphBuilder::VisitToName( 1038 void BytecodeGraphBuilder::VisitToName(
1031 const interpreter::BytecodeArrayIterator& iterator) { 1039 const interpreter::BytecodeArrayIterator& iterator) {
1032 UNIMPLEMENTED(); 1040 BuildCastOperator(javascript()->ToName(), iterator);
1033 } 1041 }
1034 1042
1035 1043
1036 void BytecodeGraphBuilder::VisitToNumber( 1044 void BytecodeGraphBuilder::VisitToNumber(
1037 const interpreter::BytecodeArrayIterator& iterator) { 1045 const interpreter::BytecodeArrayIterator& iterator) {
1038 UNIMPLEMENTED(); 1046 BuildCastOperator(javascript()->ToNumber(), iterator);
1039 } 1047 }
1040 1048
1041 1049
1042 void BytecodeGraphBuilder::VisitToObject( 1050 void BytecodeGraphBuilder::VisitToObject(
1043 const interpreter::BytecodeArrayIterator& iterator) { 1051 const interpreter::BytecodeArrayIterator& iterator) {
1044 UNIMPLEMENTED(); 1052 BuildCastOperator(javascript()->ToObject(), iterator);
1045 } 1053 }
1046 1054
1047 1055
1048 void BytecodeGraphBuilder::VisitJump( 1056 void BytecodeGraphBuilder::VisitJump(
1049 const interpreter::BytecodeArrayIterator& iterator) { 1057 const interpreter::BytecodeArrayIterator& iterator) {
1050 UNIMPLEMENTED(); 1058 UNIMPLEMENTED();
1051 } 1059 }
1052 1060
1053 1061
1054 void BytecodeGraphBuilder::VisitJumpConstant( 1062 void BytecodeGraphBuilder::VisitJumpConstant(
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 1259
1252 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { 1260 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) {
1253 if (environment()->IsMarkedAsUnreachable()) return; 1261 if (environment()->IsMarkedAsUnreachable()) return;
1254 environment()->MarkAsUnreachable(); 1262 environment()->MarkAsUnreachable();
1255 exit_controls_.push_back(exit); 1263 exit_controls_.push_back(exit);
1256 } 1264 }
1257 1265
1258 } // namespace compiler 1266 } // namespace compiler
1259 } // namespace internal 1267 } // namespace internal
1260 } // namespace v8 1268 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698