OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/ast.h" | 5 #include "src/ast.h" |
6 | 6 |
7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
8 #include "src/builtins.h" | 8 #include "src/builtins.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 set_dont_crankshaft_reason(k##NodeType); \ | 1019 set_dont_crankshaft_reason(k##NodeType); \ |
1020 add_flag(kDontSelfOptimize); \ | 1020 add_flag(kDontSelfOptimize); \ |
1021 } | 1021 } |
1022 #define DONT_TURBOFAN_NODE(NodeType) \ | 1022 #define DONT_TURBOFAN_NODE(NodeType) \ |
1023 void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \ | 1023 void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \ |
1024 increase_node_count(); \ | 1024 increase_node_count(); \ |
1025 set_dont_crankshaft_reason(k##NodeType); \ | 1025 set_dont_crankshaft_reason(k##NodeType); \ |
1026 set_dont_turbofan_reason(k##NodeType); \ | 1026 set_dont_turbofan_reason(k##NodeType); \ |
1027 add_flag(kDontSelfOptimize); \ | 1027 add_flag(kDontSelfOptimize); \ |
1028 } | 1028 } |
| 1029 #define DONT_TURBOFAN_NODE_WITH_FEEDBACK_SLOTS(NodeType) \ |
| 1030 void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \ |
| 1031 increase_node_count(); \ |
| 1032 add_slot_node(node); \ |
| 1033 set_dont_crankshaft_reason(k##NodeType); \ |
| 1034 set_dont_turbofan_reason(k##NodeType); \ |
| 1035 add_flag(kDontSelfOptimize); \ |
| 1036 } |
1029 #define DONT_SELFOPTIMIZE_NODE(NodeType) \ | 1037 #define DONT_SELFOPTIMIZE_NODE(NodeType) \ |
1030 void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \ | 1038 void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \ |
1031 increase_node_count(); \ | 1039 increase_node_count(); \ |
1032 add_flag(kDontSelfOptimize); \ | 1040 add_flag(kDontSelfOptimize); \ |
1033 } | 1041 } |
1034 #define DONT_SELFOPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(NodeType) \ | 1042 #define DONT_SELFOPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(NodeType) \ |
1035 void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \ | 1043 void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \ |
1036 increase_node_count(); \ | 1044 increase_node_count(); \ |
1037 add_slot_node(node); \ | 1045 add_slot_node(node); \ |
1038 add_flag(kDontSelfOptimize); \ | 1046 add_flag(kDontSelfOptimize); \ |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 DONT_OPTIMIZE_NODE(NativeFunctionLiteral) | 1101 DONT_OPTIMIZE_NODE(NativeFunctionLiteral) |
1094 | 1102 |
1095 DONT_OPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(Yield) | 1103 DONT_OPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(Yield) |
1096 | 1104 |
1097 // TODO(turbofan): Remove the dont_turbofan_reason once this list is empty. | 1105 // TODO(turbofan): Remove the dont_turbofan_reason once this list is empty. |
1098 // This list must be kept in sync with Pipeline::GenerateCode. | 1106 // This list must be kept in sync with Pipeline::GenerateCode. |
1099 DONT_TURBOFAN_NODE(ForOfStatement) | 1107 DONT_TURBOFAN_NODE(ForOfStatement) |
1100 DONT_TURBOFAN_NODE(TryCatchStatement) | 1108 DONT_TURBOFAN_NODE(TryCatchStatement) |
1101 DONT_TURBOFAN_NODE(TryFinallyStatement) | 1109 DONT_TURBOFAN_NODE(TryFinallyStatement) |
1102 DONT_TURBOFAN_NODE(ClassLiteral) | 1110 DONT_TURBOFAN_NODE(ClassLiteral) |
1103 DONT_TURBOFAN_NODE(SuperReference) | 1111 |
| 1112 DONT_TURBOFAN_NODE_WITH_FEEDBACK_SLOTS(SuperReference) |
1104 | 1113 |
1105 DONT_SELFOPTIMIZE_NODE(DoWhileStatement) | 1114 DONT_SELFOPTIMIZE_NODE(DoWhileStatement) |
1106 DONT_SELFOPTIMIZE_NODE(WhileStatement) | 1115 DONT_SELFOPTIMIZE_NODE(WhileStatement) |
1107 DONT_SELFOPTIMIZE_NODE(ForStatement) | 1116 DONT_SELFOPTIMIZE_NODE(ForStatement) |
1108 | 1117 |
1109 DONT_SELFOPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(ForInStatement) | 1118 DONT_SELFOPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(ForInStatement) |
1110 | 1119 |
1111 DONT_CACHE_NODE(ModuleLiteral) | 1120 DONT_CACHE_NODE(ModuleLiteral) |
1112 | 1121 |
1113 | 1122 |
(...skipping 22 matching lines...) Expand all Loading... |
1136 // static | 1145 // static |
1137 bool Literal::Match(void* literal1, void* literal2) { | 1146 bool Literal::Match(void* literal1, void* literal2) { |
1138 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1147 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1139 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1148 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1140 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || | 1149 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || |
1141 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1150 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1142 } | 1151 } |
1143 | 1152 |
1144 | 1153 |
1145 } } // namespace v8::internal | 1154 } } // namespace v8::internal |
OLD | NEW |