| 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 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
| 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
| 7 | 7 |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 | 10 |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 const HValue* value; | 945 const HValue* value; |
| 946 }; | 946 }; |
| 947 | 947 |
| 948 | 948 |
| 949 std::ostream& operator<<(std::ostream& os, const HValue& v); | 949 std::ostream& operator<<(std::ostream& os, const HValue& v); |
| 950 std::ostream& operator<<(std::ostream& os, const NameOf& v); | 950 std::ostream& operator<<(std::ostream& os, const NameOf& v); |
| 951 std::ostream& operator<<(std::ostream& os, const TypeOf& v); | 951 std::ostream& operator<<(std::ostream& os, const TypeOf& v); |
| 952 std::ostream& operator<<(std::ostream& os, const ChangesOf& v); | 952 std::ostream& operator<<(std::ostream& os, const ChangesOf& v); |
| 953 | 953 |
| 954 | 954 |
| 955 #define DECLARE_INSTRUCTION_FACTORY_P0(I) \ | 955 #define DECLARE_INSTRUCTION_FACTORY_P0(I) \ |
| 956 static I* New(Zone* zone, HValue* context) { \ | 956 static I* New(Isolate* isolate, Zone* zone, HValue* context) { \ |
| 957 return new(zone) I(); \ | 957 return new (zone) I(); \ |
| 958 } | 958 } |
| 959 | 959 |
| 960 #define DECLARE_INSTRUCTION_FACTORY_P1(I, P1) \ | 960 #define DECLARE_INSTRUCTION_FACTORY_P1(I, P1) \ |
| 961 static I* New(Zone* zone, HValue* context, P1 p1) { \ | 961 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1) { \ |
| 962 return new(zone) I(p1); \ | 962 return new (zone) I(p1); \ |
| 963 } | 963 } |
| 964 | 964 |
| 965 #define DECLARE_INSTRUCTION_FACTORY_P2(I, P1, P2) \ | 965 #define DECLARE_INSTRUCTION_FACTORY_P2(I, P1, P2) \ |
| 966 static I* New(Zone* zone, HValue* context, P1 p1, P2 p2) { \ | 966 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2) { \ |
| 967 return new(zone) I(p1, p2); \ | 967 return new (zone) I(p1, p2); \ |
| 968 } | 968 } |
| 969 | 969 |
| 970 #define DECLARE_INSTRUCTION_FACTORY_P3(I, P1, P2, P3) \ | 970 #define DECLARE_INSTRUCTION_FACTORY_P3(I, P1, P2, P3) \ |
| 971 static I* New(Zone* zone, HValue* context, P1 p1, P2 p2, P3 p3) { \ | 971 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \ |
| 972 return new(zone) I(p1, p2, p3); \ | 972 P3 p3) { \ |
| 973 return new (zone) I(p1, p2, p3); \ |
| 973 } | 974 } |
| 974 | 975 |
| 975 #define DECLARE_INSTRUCTION_FACTORY_P4(I, P1, P2, P3, P4) \ | 976 #define DECLARE_INSTRUCTION_FACTORY_P4(I, P1, P2, P3, P4) \ |
| 976 static I* New(Zone* zone, \ | 977 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \ |
| 977 HValue* context, \ | 978 P3 p3, P4 p4) { \ |
| 978 P1 p1, \ | 979 return new (zone) I(p1, p2, p3, p4); \ |
| 979 P2 p2, \ | |
| 980 P3 p3, \ | |
| 981 P4 p4) { \ | |
| 982 return new(zone) I(p1, p2, p3, p4); \ | |
| 983 } | 980 } |
| 984 | 981 |
| 985 #define DECLARE_INSTRUCTION_FACTORY_P5(I, P1, P2, P3, P4, P5) \ | 982 #define DECLARE_INSTRUCTION_FACTORY_P5(I, P1, P2, P3, P4, P5) \ |
| 986 static I* New(Zone* zone, \ | 983 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \ |
| 987 HValue* context, \ | 984 P3 p3, P4 p4, P5 p5) { \ |
| 988 P1 p1, \ | 985 return new (zone) I(p1, p2, p3, p4, p5); \ |
| 989 P2 p2, \ | |
| 990 P3 p3, \ | |
| 991 P4 p4, \ | |
| 992 P5 p5) { \ | |
| 993 return new(zone) I(p1, p2, p3, p4, p5); \ | |
| 994 } | 986 } |
| 995 | 987 |
| 996 #define DECLARE_INSTRUCTION_FACTORY_P6(I, P1, P2, P3, P4, P5, P6) \ | 988 #define DECLARE_INSTRUCTION_FACTORY_P6(I, P1, P2, P3, P4, P5, P6) \ |
| 997 static I* New(Zone* zone, \ | 989 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \ |
| 998 HValue* context, \ | 990 P3 p3, P4 p4, P5 p5, P6 p6) { \ |
| 999 P1 p1, \ | 991 return new (zone) I(p1, p2, p3, p4, p5, p6); \ |
| 1000 P2 p2, \ | |
| 1001 P3 p3, \ | |
| 1002 P4 p4, \ | |
| 1003 P5 p5, \ | |
| 1004 P6 p6) { \ | |
| 1005 return new(zone) I(p1, p2, p3, p4, p5, p6); \ | |
| 1006 } | 992 } |
| 1007 | 993 |
| 1008 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P0(I) \ | 994 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P0(I) \ |
| 1009 static I* New(Zone* zone, HValue* context) { \ | 995 static I* New(Isolate* isolate, Zone* zone, HValue* context) { \ |
| 1010 return new(zone) I(context); \ | 996 return new (zone) I(context); \ |
| 1011 } | 997 } |
| 1012 | 998 |
| 1013 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(I, P1) \ | 999 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(I, P1) \ |
| 1014 static I* New(Zone* zone, HValue* context, P1 p1) { \ | 1000 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1) { \ |
| 1015 return new(zone) I(context, p1); \ | 1001 return new (zone) I(context, p1); \ |
| 1016 } | 1002 } |
| 1017 | 1003 |
| 1018 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(I, P1, P2) \ | 1004 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(I, P1, P2) \ |
| 1019 static I* New(Zone* zone, HValue* context, P1 p1, P2 p2) { \ | 1005 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2) { \ |
| 1020 return new(zone) I(context, p1, p2); \ | 1006 return new (zone) I(context, p1, p2); \ |
| 1021 } | 1007 } |
| 1022 | 1008 |
| 1023 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(I, P1, P2, P3) \ | 1009 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(I, P1, P2, P3) \ |
| 1024 static I* New(Zone* zone, HValue* context, P1 p1, P2 p2, P3 p3) { \ | 1010 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \ |
| 1025 return new(zone) I(context, p1, p2, p3); \ | 1011 P3 p3) { \ |
| 1012 return new (zone) I(context, p1, p2, p3); \ |
| 1026 } | 1013 } |
| 1027 | 1014 |
| 1028 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(I, P1, P2, P3, P4) \ | 1015 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(I, P1, P2, P3, P4) \ |
| 1029 static I* New(Zone* zone, \ | 1016 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \ |
| 1030 HValue* context, \ | 1017 P3 p3, P4 p4) { \ |
| 1031 P1 p1, \ | 1018 return new (zone) I(context, p1, p2, p3, p4); \ |
| 1032 P2 p2, \ | |
| 1033 P3 p3, \ | |
| 1034 P4 p4) { \ | |
| 1035 return new(zone) I(context, p1, p2, p3, p4); \ | |
| 1036 } | 1019 } |
| 1037 | 1020 |
| 1038 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(I, P1, P2, P3, P4, P5) \ | 1021 #define DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(I, P1, P2, P3, P4, P5) \ |
| 1039 static I* New(Zone* zone, \ | 1022 static I* New(Isolate* isolate, Zone* zone, HValue* context, P1 p1, P2 p2, \ |
| 1040 HValue* context, \ | 1023 P3 p3, P4 p4, P5 p5) { \ |
| 1041 P1 p1, \ | 1024 return new (zone) I(context, p1, p2, p3, p4, p5); \ |
| 1042 P2 p2, \ | |
| 1043 P3 p3, \ | |
| 1044 P4 p4, \ | |
| 1045 P5 p5) { \ | |
| 1046 return new(zone) I(context, p1, p2, p3, p4, p5); \ | |
| 1047 } | 1025 } |
| 1048 | 1026 |
| 1049 | 1027 |
| 1050 // A helper class to represent per-operand position information attached to | 1028 // A helper class to represent per-operand position information attached to |
| 1051 // the HInstruction in the compact form. Uses tagging to distinguish between | 1029 // the HInstruction in the compact form. Uses tagging to distinguish between |
| 1052 // case when only instruction's position is available and case when operands' | 1030 // case when only instruction's position is available and case when operands' |
| 1053 // positions are also available. | 1031 // positions are also available. |
| 1054 // In the first case it contains intruction's position as a tagged value. | 1032 // In the first case it contains intruction's position as a tagged value. |
| 1055 // In the second case it points to an array which contains instruction's | 1033 // In the second case it points to an array which contains instruction's |
| 1056 // position and operands' positions. | 1034 // position and operands' positions. |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 } | 1355 } |
| 1378 | 1356 |
| 1379 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 1357 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
| 1380 | 1358 |
| 1381 DECLARE_CONCRETE_INSTRUCTION(Goto) | 1359 DECLARE_CONCRETE_INSTRUCTION(Goto) |
| 1382 }; | 1360 }; |
| 1383 | 1361 |
| 1384 | 1362 |
| 1385 class HDeoptimize FINAL : public HTemplateControlInstruction<1, 0> { | 1363 class HDeoptimize FINAL : public HTemplateControlInstruction<1, 0> { |
| 1386 public: | 1364 public: |
| 1387 static HDeoptimize* New(Zone* zone, | 1365 static HDeoptimize* New(Isolate* isolate, Zone* zone, HValue* context, |
| 1388 HValue* context, | 1366 const char* reason, Deoptimizer::BailoutType type, |
| 1389 const char* reason, | |
| 1390 Deoptimizer::BailoutType type, | |
| 1391 HBasicBlock* unreachable_continuation) { | 1367 HBasicBlock* unreachable_continuation) { |
| 1392 return new(zone) HDeoptimize(reason, type, unreachable_continuation); | 1368 return new(zone) HDeoptimize(reason, type, unreachable_continuation); |
| 1393 } | 1369 } |
| 1394 | 1370 |
| 1395 bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE { | 1371 bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE { |
| 1396 *block = NULL; | 1372 *block = NULL; |
| 1397 return true; | 1373 return true; |
| 1398 } | 1374 } |
| 1399 | 1375 |
| 1400 Representation RequiredInputRepresentation(int index) OVERRIDE { | 1376 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 | 1606 |
| 1631 DECLARE_CONCRETE_INSTRUCTION(UseConst) | 1607 DECLARE_CONCRETE_INSTRUCTION(UseConst) |
| 1632 | 1608 |
| 1633 private: | 1609 private: |
| 1634 explicit HUseConst(HValue* old_value) : HUnaryOperation(old_value) { } | 1610 explicit HUseConst(HValue* old_value) : HUnaryOperation(old_value) { } |
| 1635 }; | 1611 }; |
| 1636 | 1612 |
| 1637 | 1613 |
| 1638 class HForceRepresentation FINAL : public HTemplateInstruction<1> { | 1614 class HForceRepresentation FINAL : public HTemplateInstruction<1> { |
| 1639 public: | 1615 public: |
| 1640 static HInstruction* New(Zone* zone, HValue* context, HValue* value, | 1616 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 1617 HValue* value, |
| 1641 Representation required_representation); | 1618 Representation required_representation); |
| 1642 | 1619 |
| 1643 HValue* value() const { return OperandAt(0); } | 1620 HValue* value() const { return OperandAt(0); } |
| 1644 | 1621 |
| 1645 Representation observed_input_representation(int index) OVERRIDE { | 1622 Representation observed_input_representation(int index) OVERRIDE { |
| 1646 // We haven't actually *observed* this, but it's closer to the truth | 1623 // We haven't actually *observed* this, but it's closer to the truth |
| 1647 // than 'None'. | 1624 // than 'None'. |
| 1648 return representation(); // Same as the output representation. | 1625 return representation(); // Same as the output representation. |
| 1649 } | 1626 } |
| 1650 Representation RequiredInputRepresentation(int index) OVERRIDE { | 1627 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. | 1988 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. |
| 2012 }; | 1989 }; |
| 2013 | 1990 |
| 2014 | 1991 |
| 2015 class HArgumentsObject; | 1992 class HArgumentsObject; |
| 2016 class HConstant; | 1993 class HConstant; |
| 2017 | 1994 |
| 2018 | 1995 |
| 2019 class HEnterInlined FINAL : public HTemplateInstruction<0> { | 1996 class HEnterInlined FINAL : public HTemplateInstruction<0> { |
| 2020 public: | 1997 public: |
| 2021 static HEnterInlined* New(Zone* zone, HValue* context, BailoutId return_id, | 1998 static HEnterInlined* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2022 Handle<JSFunction> closure, | 1999 BailoutId return_id, Handle<JSFunction> closure, |
| 2023 HConstant* closure_context, int arguments_count, | 2000 HConstant* closure_context, int arguments_count, |
| 2024 FunctionLiteral* function, | 2001 FunctionLiteral* function, |
| 2025 InliningKind inlining_kind, Variable* arguments_var, | 2002 InliningKind inlining_kind, Variable* arguments_var, |
| 2026 HArgumentsObject* arguments_object) { | 2003 HArgumentsObject* arguments_object) { |
| 2027 return new (zone) HEnterInlined(return_id, closure, closure_context, | 2004 return new (zone) HEnterInlined(return_id, closure, closure_context, |
| 2028 arguments_count, function, inlining_kind, | 2005 arguments_count, function, inlining_kind, |
| 2029 arguments_var, arguments_object, zone); | 2006 arguments_var, arguments_object, zone); |
| 2030 } | 2007 } |
| 2031 | 2008 |
| 2032 void RegisterReturnTarget(HBasicBlock* return_target, Zone* zone); | 2009 void RegisterReturnTarget(HBasicBlock* return_target, Zone* zone); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2100 DECLARE_CONCRETE_INSTRUCTION(LeaveInlined) | 2077 DECLARE_CONCRETE_INSTRUCTION(LeaveInlined) |
| 2101 | 2078 |
| 2102 private: | 2079 private: |
| 2103 HEnterInlined* entry_; | 2080 HEnterInlined* entry_; |
| 2104 int drop_count_; | 2081 int drop_count_; |
| 2105 }; | 2082 }; |
| 2106 | 2083 |
| 2107 | 2084 |
| 2108 class HPushArguments FINAL : public HInstruction { | 2085 class HPushArguments FINAL : public HInstruction { |
| 2109 public: | 2086 public: |
| 2110 static HPushArguments* New(Zone* zone, HValue* context) { | 2087 static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context) { |
| 2111 return new(zone) HPushArguments(zone); | 2088 return new(zone) HPushArguments(zone); |
| 2112 } | 2089 } |
| 2113 static HPushArguments* New(Zone* zone, HValue* context, HValue* arg1) { | 2090 static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2091 HValue* arg1) { |
| 2114 HPushArguments* instr = new(zone) HPushArguments(zone); | 2092 HPushArguments* instr = new(zone) HPushArguments(zone); |
| 2115 instr->AddInput(arg1); | 2093 instr->AddInput(arg1); |
| 2116 return instr; | 2094 return instr; |
| 2117 } | 2095 } |
| 2118 static HPushArguments* New(Zone* zone, HValue* context, HValue* arg1, | 2096 static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2119 HValue* arg2) { | 2097 HValue* arg1, HValue* arg2) { |
| 2120 HPushArguments* instr = new(zone) HPushArguments(zone); | 2098 HPushArguments* instr = new(zone) HPushArguments(zone); |
| 2121 instr->AddInput(arg1); | 2099 instr->AddInput(arg1); |
| 2122 instr->AddInput(arg2); | 2100 instr->AddInput(arg2); |
| 2123 return instr; | 2101 return instr; |
| 2124 } | 2102 } |
| 2125 static HPushArguments* New(Zone* zone, HValue* context, HValue* arg1, | 2103 static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2126 HValue* arg2, HValue* arg3) { | 2104 HValue* arg1, HValue* arg2, HValue* arg3) { |
| 2127 HPushArguments* instr = new(zone) HPushArguments(zone); | 2105 HPushArguments* instr = new(zone) HPushArguments(zone); |
| 2128 instr->AddInput(arg1); | 2106 instr->AddInput(arg1); |
| 2129 instr->AddInput(arg2); | 2107 instr->AddInput(arg2); |
| 2130 instr->AddInput(arg3); | 2108 instr->AddInput(arg3); |
| 2131 return instr; | 2109 return instr; |
| 2132 } | 2110 } |
| 2133 static HPushArguments* New(Zone* zone, HValue* context, HValue* arg1, | 2111 static HPushArguments* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2134 HValue* arg2, HValue* arg3, HValue* arg4) { | 2112 HValue* arg1, HValue* arg2, HValue* arg3, |
| 2113 HValue* arg4) { |
| 2135 HPushArguments* instr = new(zone) HPushArguments(zone); | 2114 HPushArguments* instr = new(zone) HPushArguments(zone); |
| 2136 instr->AddInput(arg1); | 2115 instr->AddInput(arg1); |
| 2137 instr->AddInput(arg2); | 2116 instr->AddInput(arg2); |
| 2138 instr->AddInput(arg3); | 2117 instr->AddInput(arg3); |
| 2139 instr->AddInput(arg4); | 2118 instr->AddInput(arg4); |
| 2140 return instr; | 2119 return instr; |
| 2141 } | 2120 } |
| 2142 | 2121 |
| 2143 Representation RequiredInputRepresentation(int index) OVERRIDE { | 2122 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 2144 return Representation::Tagged(); | 2123 return Representation::Tagged(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2275 return Representation::Tagged(); | 2254 return Representation::Tagged(); |
| 2276 } | 2255 } |
| 2277 | 2256 |
| 2278 HValue* first() const { return OperandAt(0); } | 2257 HValue* first() const { return OperandAt(0); } |
| 2279 HValue* second() const { return OperandAt(1); } | 2258 HValue* second() const { return OperandAt(1); } |
| 2280 }; | 2259 }; |
| 2281 | 2260 |
| 2282 | 2261 |
| 2283 class HCallJSFunction FINAL : public HCall<1> { | 2262 class HCallJSFunction FINAL : public HCall<1> { |
| 2284 public: | 2263 public: |
| 2285 static HCallJSFunction* New(Zone* zone, | 2264 static HCallJSFunction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2286 HValue* context, | 2265 HValue* function, int argument_count, |
| 2287 HValue* function, | |
| 2288 int argument_count, | |
| 2289 bool pass_argument_count); | 2266 bool pass_argument_count); |
| 2290 | 2267 |
| 2291 HValue* function() const { return OperandAt(0); } | 2268 HValue* function() const { return OperandAt(0); } |
| 2292 | 2269 |
| 2293 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 2270 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
| 2294 | 2271 |
| 2295 Representation RequiredInputRepresentation(int index) FINAL { | 2272 Representation RequiredInputRepresentation(int index) FINAL { |
| 2296 DCHECK(index == 0); | 2273 DCHECK(index == 0); |
| 2297 return Representation::Tagged(); | 2274 return Representation::Tagged(); |
| 2298 } | 2275 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2318 bool pass_argument_count_; | 2295 bool pass_argument_count_; |
| 2319 bool has_stack_check_; | 2296 bool has_stack_check_; |
| 2320 }; | 2297 }; |
| 2321 | 2298 |
| 2322 | 2299 |
| 2323 enum CallMode { NORMAL_CALL, TAIL_CALL }; | 2300 enum CallMode { NORMAL_CALL, TAIL_CALL }; |
| 2324 | 2301 |
| 2325 | 2302 |
| 2326 class HCallWithDescriptor FINAL : public HInstruction { | 2303 class HCallWithDescriptor FINAL : public HInstruction { |
| 2327 public: | 2304 public: |
| 2328 static HCallWithDescriptor* New(Zone* zone, HValue* context, HValue* target, | 2305 static HCallWithDescriptor* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2329 int argument_count, | 2306 HValue* target, int argument_count, |
| 2330 CallInterfaceDescriptor descriptor, | 2307 CallInterfaceDescriptor descriptor, |
| 2331 const Vector<HValue*>& operands, | 2308 const Vector<HValue*>& operands, |
| 2332 CallMode call_mode = NORMAL_CALL) { | 2309 CallMode call_mode = NORMAL_CALL) { |
| 2333 DCHECK(operands.length() == descriptor.GetEnvironmentLength()); | 2310 DCHECK(operands.length() == descriptor.GetEnvironmentLength()); |
| 2334 HCallWithDescriptor* res = new (zone) HCallWithDescriptor( | 2311 HCallWithDescriptor* res = new (zone) HCallWithDescriptor( |
| 2335 target, argument_count, descriptor, operands, call_mode, zone); | 2312 target, argument_count, descriptor, operands, call_mode, zone); |
| 2336 return res; | 2313 return res; |
| 2337 } | 2314 } |
| 2338 | 2315 |
| 2339 int OperandCount() const FINAL { return values_.length(); } | 2316 int OperandCount() const FINAL { return values_.length(); } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2415 int argument_count) | 2392 int argument_count) |
| 2416 : HBinaryCall(context, function, argument_count), | 2393 : HBinaryCall(context, function, argument_count), |
| 2417 known_function_(known_function) { | 2394 known_function_(known_function) { |
| 2418 formal_parameter_count_ = known_function.is_null() | 2395 formal_parameter_count_ = known_function.is_null() |
| 2419 ? 0 : known_function->shared()->formal_parameter_count(); | 2396 ? 0 : known_function->shared()->formal_parameter_count(); |
| 2420 has_stack_check_ = !known_function.is_null() && | 2397 has_stack_check_ = !known_function.is_null() && |
| 2421 (known_function->code()->kind() == Code::FUNCTION || | 2398 (known_function->code()->kind() == Code::FUNCTION || |
| 2422 known_function->code()->kind() == Code::OPTIMIZED_FUNCTION); | 2399 known_function->code()->kind() == Code::OPTIMIZED_FUNCTION); |
| 2423 } | 2400 } |
| 2424 | 2401 |
| 2425 static HInvokeFunction* New(Zone* zone, | 2402 static HInvokeFunction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2426 HValue* context, | |
| 2427 HValue* function, | 2403 HValue* function, |
| 2428 Handle<JSFunction> known_function, | 2404 Handle<JSFunction> known_function, |
| 2429 int argument_count) { | 2405 int argument_count) { |
| 2430 return new(zone) HInvokeFunction(context, function, | 2406 return new(zone) HInvokeFunction(context, function, |
| 2431 known_function, argument_count); | 2407 known_function, argument_count); |
| 2432 } | 2408 } |
| 2433 | 2409 |
| 2434 HValue* context() { return first(); } | 2410 HValue* context() { return first(); } |
| 2435 HValue* function() { return second(); } | 2411 HValue* function() { return second(); } |
| 2436 Handle<JSFunction> known_function() { return known_function_; } | 2412 Handle<JSFunction> known_function() { return known_function_; } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2577 SetFlag(kUseGVN); | 2553 SetFlag(kUseGVN); |
| 2578 SetDependsOnFlag(kMaps); | 2554 SetDependsOnFlag(kMaps); |
| 2579 } | 2555 } |
| 2580 | 2556 |
| 2581 bool IsDeletable() const OVERRIDE { return true; } | 2557 bool IsDeletable() const OVERRIDE { return true; } |
| 2582 }; | 2558 }; |
| 2583 | 2559 |
| 2584 | 2560 |
| 2585 class HUnaryMathOperation FINAL : public HTemplateInstruction<2> { | 2561 class HUnaryMathOperation FINAL : public HTemplateInstruction<2> { |
| 2586 public: | 2562 public: |
| 2587 static HInstruction* New(Zone* zone, | 2563 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2588 HValue* context, | 2564 HValue* value, BuiltinFunctionId op); |
| 2589 HValue* value, | |
| 2590 BuiltinFunctionId op); | |
| 2591 | 2565 |
| 2592 HValue* context() const { return OperandAt(0); } | 2566 HValue* context() const { return OperandAt(0); } |
| 2593 HValue* value() const { return OperandAt(1); } | 2567 HValue* value() const { return OperandAt(1); } |
| 2594 | 2568 |
| 2595 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 2569 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
| 2596 | 2570 |
| 2597 Representation RequiredInputRepresentation(int index) OVERRIDE { | 2571 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 2598 if (index == 0) { | 2572 if (index == 0) { |
| 2599 return Representation::Tagged(); | 2573 return Representation::Tagged(); |
| 2600 } else { | 2574 } else { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2721 } | 2695 } |
| 2722 | 2696 |
| 2723 bool IsDeletable() const OVERRIDE { return true; } | 2697 bool IsDeletable() const OVERRIDE { return true; } |
| 2724 | 2698 |
| 2725 const Heap::RootListIndex index_; | 2699 const Heap::RootListIndex index_; |
| 2726 }; | 2700 }; |
| 2727 | 2701 |
| 2728 | 2702 |
| 2729 class HCheckMaps FINAL : public HTemplateInstruction<2> { | 2703 class HCheckMaps FINAL : public HTemplateInstruction<2> { |
| 2730 public: | 2704 public: |
| 2731 static HCheckMaps* New(Zone* zone, HValue* context, HValue* value, | 2705 static HCheckMaps* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2732 Handle<Map> map, HValue* typecheck = NULL) { | 2706 HValue* value, Handle<Map> map, |
| 2707 HValue* typecheck = NULL) { |
| 2733 return new(zone) HCheckMaps(value, new(zone) UniqueSet<Map>( | 2708 return new(zone) HCheckMaps(value, new(zone) UniqueSet<Map>( |
| 2734 Unique<Map>::CreateImmovable(map), zone), typecheck); | 2709 Unique<Map>::CreateImmovable(map), zone), typecheck); |
| 2735 } | 2710 } |
| 2736 static HCheckMaps* New(Zone* zone, HValue* context, | 2711 static HCheckMaps* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2737 HValue* value, SmallMapList* map_list, | 2712 HValue* value, SmallMapList* map_list, |
| 2738 HValue* typecheck = NULL) { | 2713 HValue* typecheck = NULL) { |
| 2739 UniqueSet<Map>* maps = new(zone) UniqueSet<Map>(map_list->length(), zone); | 2714 UniqueSet<Map>* maps = new(zone) UniqueSet<Map>(map_list->length(), zone); |
| 2740 for (int i = 0; i < map_list->length(); ++i) { | 2715 for (int i = 0; i < map_list->length(); ++i) { |
| 2741 maps->Add(Unique<Map>::CreateImmovable(map_list->at(i)), zone); | 2716 maps->Add(Unique<Map>::CreateImmovable(map_list->at(i)), zone); |
| 2742 } | 2717 } |
| 2743 return new(zone) HCheckMaps(value, maps, typecheck); | 2718 return new(zone) HCheckMaps(value, maps, typecheck); |
| 2744 } | 2719 } |
| 2745 | 2720 |
| 2746 bool IsStabilityCheck() const { | 2721 bool IsStabilityCheck() const { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2856 class IsStabilityCheckField : public BitField<bool, 1, 1> {}; | 2831 class IsStabilityCheckField : public BitField<bool, 1, 1> {}; |
| 2857 class MapsAreStableField : public BitField<bool, 2, 1> {}; | 2832 class MapsAreStableField : public BitField<bool, 2, 1> {}; |
| 2858 | 2833 |
| 2859 const UniqueSet<Map>* maps_; | 2834 const UniqueSet<Map>* maps_; |
| 2860 uint32_t bit_field_; | 2835 uint32_t bit_field_; |
| 2861 }; | 2836 }; |
| 2862 | 2837 |
| 2863 | 2838 |
| 2864 class HCheckValue FINAL : public HUnaryOperation { | 2839 class HCheckValue FINAL : public HUnaryOperation { |
| 2865 public: | 2840 public: |
| 2866 static HCheckValue* New(Zone* zone, HValue* context, | 2841 static HCheckValue* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2867 HValue* value, Handle<JSFunction> func) { | 2842 HValue* value, Handle<JSFunction> func) { |
| 2868 bool in_new_space = zone->isolate()->heap()->InNewSpace(*func); | 2843 bool in_new_space = isolate->heap()->InNewSpace(*func); |
| 2869 // NOTE: We create an uninitialized Unique and initialize it later. | 2844 // NOTE: We create an uninitialized Unique and initialize it later. |
| 2870 // This is because a JSFunction can move due to GC during graph creation. | 2845 // This is because a JSFunction can move due to GC during graph creation. |
| 2871 // TODO(titzer): This is a migration crutch. Replace with some kind of | 2846 // TODO(titzer): This is a migration crutch. Replace with some kind of |
| 2872 // Uniqueness scope later. | 2847 // Uniqueness scope later. |
| 2873 Unique<JSFunction> target = Unique<JSFunction>::CreateUninitialized(func); | 2848 Unique<JSFunction> target = Unique<JSFunction>::CreateUninitialized(func); |
| 2874 HCheckValue* check = new(zone) HCheckValue(value, target, in_new_space); | 2849 HCheckValue* check = new(zone) HCheckValue(value, target, in_new_space); |
| 2875 return check; | 2850 return check; |
| 2876 } | 2851 } |
| 2877 static HCheckValue* New(Zone* zone, HValue* context, | 2852 static HCheckValue* New(Isolate* isolate, Zone* zone, HValue* context, |
| 2878 HValue* value, Unique<HeapObject> target, | 2853 HValue* value, Unique<HeapObject> target, |
| 2879 bool object_in_new_space) { | 2854 bool object_in_new_space) { |
| 2880 return new(zone) HCheckValue(value, target, object_in_new_space); | 2855 return new(zone) HCheckValue(value, target, object_in_new_space); |
| 2881 } | 2856 } |
| 2882 | 2857 |
| 2883 void FinalizeUniqueness() OVERRIDE { | 2858 void FinalizeUniqueness() OVERRIDE { |
| 2884 object_ = Unique<HeapObject>(object_.handle()); | 2859 object_ = Unique<HeapObject>(object_.handle()); |
| 2885 } | 2860 } |
| 2886 | 2861 |
| 2887 Representation RequiredInputRepresentation(int index) OVERRIDE { | 2862 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3409 values_[index] = value; | 3384 values_[index] = value; |
| 3410 } | 3385 } |
| 3411 | 3386 |
| 3412 // List of values tracked by this marker. | 3387 // List of values tracked by this marker. |
| 3413 ZoneList<HValue*> values_; | 3388 ZoneList<HValue*> values_; |
| 3414 }; | 3389 }; |
| 3415 | 3390 |
| 3416 | 3391 |
| 3417 class HArgumentsObject FINAL : public HDematerializedObject { | 3392 class HArgumentsObject FINAL : public HDematerializedObject { |
| 3418 public: | 3393 public: |
| 3419 static HArgumentsObject* New(Zone* zone, HValue* context, int count) { | 3394 static HArgumentsObject* New(Isolate* isolate, Zone* zone, HValue* context, |
| 3395 int count) { |
| 3420 return new(zone) HArgumentsObject(count, zone); | 3396 return new(zone) HArgumentsObject(count, zone); |
| 3421 } | 3397 } |
| 3422 | 3398 |
| 3423 // The values contain a list of all elements in the arguments object | 3399 // The values contain a list of all elements in the arguments object |
| 3424 // including the receiver object, which is skipped when materializing. | 3400 // including the receiver object, which is skipped when materializing. |
| 3425 const ZoneList<HValue*>* arguments_values() const { return &values_; } | 3401 const ZoneList<HValue*>* arguments_values() const { return &values_; } |
| 3426 int arguments_count() const { return values_.length(); } | 3402 int arguments_count() const { return values_.length(); } |
| 3427 | 3403 |
| 3428 void AddArgument(HValue* argument, Zone* zone) { | 3404 void AddArgument(HValue* argument, Zone* zone) { |
| 3429 values_.Add(NULL, zone); // Resize list. | 3405 values_.Add(NULL, zone); // Resize list. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3486 public: | 3462 public: |
| 3487 enum Special { kHoleNaN }; | 3463 enum Special { kHoleNaN }; |
| 3488 | 3464 |
| 3489 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Special); | 3465 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Special); |
| 3490 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, int32_t); | 3466 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, int32_t); |
| 3491 DECLARE_INSTRUCTION_FACTORY_P2(HConstant, int32_t, Representation); | 3467 DECLARE_INSTRUCTION_FACTORY_P2(HConstant, int32_t, Representation); |
| 3492 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, double); | 3468 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, double); |
| 3493 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Handle<Object>); | 3469 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Handle<Object>); |
| 3494 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, ExternalReference); | 3470 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, ExternalReference); |
| 3495 | 3471 |
| 3496 static HConstant* CreateAndInsertAfter(Zone* zone, | 3472 static HConstant* CreateAndInsertAfter(Isolate* isolate, Zone* zone, |
| 3497 HValue* context, | 3473 HValue* context, int32_t value, |
| 3498 int32_t value, | |
| 3499 Representation representation, | 3474 Representation representation, |
| 3500 HInstruction* instruction) { | 3475 HInstruction* instruction) { |
| 3501 return instruction->Append(HConstant::New( | 3476 return instruction->Append( |
| 3502 zone, context, value, representation)); | 3477 HConstant::New(isolate, zone, context, value, representation)); |
| 3503 } | 3478 } |
| 3504 | 3479 |
| 3505 Handle<Map> GetMonomorphicJSObjectMap() OVERRIDE { | 3480 Handle<Map> GetMonomorphicJSObjectMap() OVERRIDE { |
| 3506 Handle<Object> object = object_.handle(); | 3481 Handle<Object> object = object_.handle(); |
| 3507 if (!object.is_null() && object->IsHeapObject()) { | 3482 if (!object.is_null() && object->IsHeapObject()) { |
| 3508 return v8::internal::handle(HeapObject::cast(*object)->map()); | 3483 return v8::internal::handle(HeapObject::cast(*object)->map()); |
| 3509 } | 3484 } |
| 3510 return Handle<Map>(); | 3485 return Handle<Map>(); |
| 3511 } | 3486 } |
| 3512 | 3487 |
| 3513 static HConstant* CreateAndInsertBefore(Zone* zone, | 3488 static HConstant* CreateAndInsertBefore(Isolate* isolate, Zone* zone, |
| 3514 HValue* context, | 3489 HValue* context, int32_t value, |
| 3515 int32_t value, | |
| 3516 Representation representation, | 3490 Representation representation, |
| 3517 HInstruction* instruction) { | 3491 HInstruction* instruction) { |
| 3518 return instruction->Prepend(HConstant::New( | 3492 return instruction->Prepend( |
| 3519 zone, context, value, representation)); | 3493 HConstant::New(isolate, zone, context, value, representation)); |
| 3520 } | 3494 } |
| 3521 | 3495 |
| 3522 static HConstant* CreateAndInsertBefore(Zone* zone, | 3496 static HConstant* CreateAndInsertBefore(Zone* zone, |
| 3523 Unique<Map> map, | 3497 Unique<Map> map, |
| 3524 bool map_is_stable, | 3498 bool map_is_stable, |
| 3525 HInstruction* instruction) { | 3499 HInstruction* instruction) { |
| 3526 return instruction->Prepend(new(zone) HConstant( | 3500 return instruction->Prepend(new(zone) HConstant( |
| 3527 map, Unique<Map>(Handle<Map>::null()), map_is_stable, | 3501 map, Unique<Map>(Handle<Map>::null()), map_is_stable, |
| 3528 Representation::Tagged(), HType::HeapObject(), true, | 3502 Representation::Tagged(), HType::HeapObject(), true, |
| 3529 false, false, MAP_TYPE)); | 3503 false, false, MAP_TYPE)); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3577 if (HasInteger32Value()) return Representation::Integer32(); | 3551 if (HasInteger32Value()) return Representation::Integer32(); |
| 3578 if (HasNumberValue()) return Representation::Double(); | 3552 if (HasNumberValue()) return Representation::Double(); |
| 3579 if (HasExternalReferenceValue()) return Representation::External(); | 3553 if (HasExternalReferenceValue()) return Representation::External(); |
| 3580 return Representation::Tagged(); | 3554 return Representation::Tagged(); |
| 3581 } | 3555 } |
| 3582 | 3556 |
| 3583 bool EmitAtUses() OVERRIDE; | 3557 bool EmitAtUses() OVERRIDE; |
| 3584 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 3558 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
| 3585 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; | 3559 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; |
| 3586 Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone); | 3560 Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone); |
| 3587 Maybe<HConstant*> CopyToTruncatedNumber(Zone* zone); | 3561 Maybe<HConstant*> CopyToTruncatedNumber(Isolate* isolate, Zone* zone); |
| 3588 bool HasInteger32Value() const { | 3562 bool HasInteger32Value() const { |
| 3589 return HasInt32ValueField::decode(bit_field_); | 3563 return HasInt32ValueField::decode(bit_field_); |
| 3590 } | 3564 } |
| 3591 int32_t Integer32Value() const { | 3565 int32_t Integer32Value() const { |
| 3592 DCHECK(HasInteger32Value()); | 3566 DCHECK(HasInteger32Value()); |
| 3593 return int32_value_; | 3567 return int32_value_; |
| 3594 } | 3568 } |
| 3595 bool HasSmiValue() const { return HasSmiValueField::decode(bit_field_); } | 3569 bool HasSmiValue() const { return HasSmiValueField::decode(bit_field_); } |
| 3596 bool HasDoubleValue() const { | 3570 bool HasDoubleValue() const { |
| 3597 return HasDoubleValueField::decode(bit_field_); | 3571 return HasDoubleValueField::decode(bit_field_); |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4788 set_representation(Representation::Tagged()); | 4762 set_representation(Representation::Tagged()); |
| 4789 SetAllSideEffects(); | 4763 SetAllSideEffects(); |
| 4790 } | 4764 } |
| 4791 | 4765 |
| 4792 Handle<JSFunction> function_; | 4766 Handle<JSFunction> function_; |
| 4793 }; | 4767 }; |
| 4794 | 4768 |
| 4795 | 4769 |
| 4796 class HPower FINAL : public HTemplateInstruction<2> { | 4770 class HPower FINAL : public HTemplateInstruction<2> { |
| 4797 public: | 4771 public: |
| 4798 static HInstruction* New(Zone* zone, | 4772 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 4799 HValue* context, | 4773 HValue* left, HValue* right); |
| 4800 HValue* left, | |
| 4801 HValue* right); | |
| 4802 | 4774 |
| 4803 HValue* left() { return OperandAt(0); } | 4775 HValue* left() { return OperandAt(0); } |
| 4804 HValue* right() const { return OperandAt(1); } | 4776 HValue* right() const { return OperandAt(1); } |
| 4805 | 4777 |
| 4806 Representation RequiredInputRepresentation(int index) OVERRIDE { | 4778 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 4807 return index == 0 | 4779 return index == 0 |
| 4808 ? Representation::Double() | 4780 ? Representation::Double() |
| 4809 : Representation::None(); | 4781 : Representation::None(); |
| 4810 } | 4782 } |
| 4811 Representation observed_input_representation(int index) OVERRIDE { | 4783 Representation observed_input_representation(int index) OVERRIDE { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 4827 } | 4799 } |
| 4828 | 4800 |
| 4829 bool IsDeletable() const OVERRIDE { | 4801 bool IsDeletable() const OVERRIDE { |
| 4830 return !right()->representation().IsTagged(); | 4802 return !right()->representation().IsTagged(); |
| 4831 } | 4803 } |
| 4832 }; | 4804 }; |
| 4833 | 4805 |
| 4834 | 4806 |
| 4835 class HAdd FINAL : public HArithmeticBinaryOperation { | 4807 class HAdd FINAL : public HArithmeticBinaryOperation { |
| 4836 public: | 4808 public: |
| 4837 static HInstruction* New(Zone* zone, | 4809 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 4838 HValue* context, | 4810 HValue* left, HValue* right); |
| 4839 HValue* left, | |
| 4840 HValue* right); | |
| 4841 | 4811 |
| 4842 // Add is only commutative if two integer values are added and not if two | 4812 // Add is only commutative if two integer values are added and not if two |
| 4843 // tagged values are added (because it might be a String concatenation). | 4813 // tagged values are added (because it might be a String concatenation). |
| 4844 // We also do not commute (pointer + offset). | 4814 // We also do not commute (pointer + offset). |
| 4845 bool IsCommutative() const OVERRIDE { | 4815 bool IsCommutative() const OVERRIDE { |
| 4846 return !representation().IsTagged() && !representation().IsExternal(); | 4816 return !representation().IsTagged() && !representation().IsExternal(); |
| 4847 } | 4817 } |
| 4848 | 4818 |
| 4849 HValue* Canonicalize() OVERRIDE; | 4819 HValue* Canonicalize() OVERRIDE; |
| 4850 | 4820 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4890 private: | 4860 private: |
| 4891 HAdd(HValue* context, HValue* left, HValue* right) | 4861 HAdd(HValue* context, HValue* left, HValue* right) |
| 4892 : HArithmeticBinaryOperation(context, left, right) { | 4862 : HArithmeticBinaryOperation(context, left, right) { |
| 4893 SetFlag(kCanOverflow); | 4863 SetFlag(kCanOverflow); |
| 4894 } | 4864 } |
| 4895 }; | 4865 }; |
| 4896 | 4866 |
| 4897 | 4867 |
| 4898 class HSub FINAL : public HArithmeticBinaryOperation { | 4868 class HSub FINAL : public HArithmeticBinaryOperation { |
| 4899 public: | 4869 public: |
| 4900 static HInstruction* New(Zone* zone, | 4870 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 4901 HValue* context, | 4871 HValue* left, HValue* right); |
| 4902 HValue* left, | |
| 4903 HValue* right); | |
| 4904 | 4872 |
| 4905 HValue* Canonicalize() OVERRIDE; | 4873 HValue* Canonicalize() OVERRIDE; |
| 4906 | 4874 |
| 4907 bool TryDecompose(DecompositionResult* decomposition) OVERRIDE { | 4875 bool TryDecompose(DecompositionResult* decomposition) OVERRIDE { |
| 4908 if (right()->IsInteger32Constant()) { | 4876 if (right()->IsInteger32Constant()) { |
| 4909 decomposition->Apply(left(), -right()->GetInteger32Constant()); | 4877 decomposition->Apply(left(), -right()->GetInteger32Constant()); |
| 4910 return true; | 4878 return true; |
| 4911 } else { | 4879 } else { |
| 4912 return false; | 4880 return false; |
| 4913 } | 4881 } |
| 4914 } | 4882 } |
| 4915 | 4883 |
| 4916 DECLARE_CONCRETE_INSTRUCTION(Sub) | 4884 DECLARE_CONCRETE_INSTRUCTION(Sub) |
| 4917 | 4885 |
| 4918 protected: | 4886 protected: |
| 4919 bool DataEquals(HValue* other) OVERRIDE { return true; } | 4887 bool DataEquals(HValue* other) OVERRIDE { return true; } |
| 4920 | 4888 |
| 4921 Range* InferRange(Zone* zone) OVERRIDE; | 4889 Range* InferRange(Zone* zone) OVERRIDE; |
| 4922 | 4890 |
| 4923 private: | 4891 private: |
| 4924 HSub(HValue* context, HValue* left, HValue* right) | 4892 HSub(HValue* context, HValue* left, HValue* right) |
| 4925 : HArithmeticBinaryOperation(context, left, right) { | 4893 : HArithmeticBinaryOperation(context, left, right) { |
| 4926 SetFlag(kCanOverflow); | 4894 SetFlag(kCanOverflow); |
| 4927 } | 4895 } |
| 4928 }; | 4896 }; |
| 4929 | 4897 |
| 4930 | 4898 |
| 4931 class HMul FINAL : public HArithmeticBinaryOperation { | 4899 class HMul FINAL : public HArithmeticBinaryOperation { |
| 4932 public: | 4900 public: |
| 4933 static HInstruction* New(Zone* zone, | 4901 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 4934 HValue* context, | 4902 HValue* left, HValue* right); |
| 4935 HValue* left, | |
| 4936 HValue* right); | |
| 4937 | 4903 |
| 4938 static HInstruction* NewImul(Zone* zone, | 4904 static HInstruction* NewImul(Isolate* isolate, Zone* zone, HValue* context, |
| 4939 HValue* context, | 4905 HValue* left, HValue* right) { |
| 4940 HValue* left, | 4906 HInstruction* instr = HMul::New(isolate, zone, context, left, right); |
| 4941 HValue* right) { | |
| 4942 HInstruction* instr = HMul::New(zone, context, left, right); | |
| 4943 if (!instr->IsMul()) return instr; | 4907 if (!instr->IsMul()) return instr; |
| 4944 HMul* mul = HMul::cast(instr); | 4908 HMul* mul = HMul::cast(instr); |
| 4945 // TODO(mstarzinger): Prevent bailout on minus zero for imul. | 4909 // TODO(mstarzinger): Prevent bailout on minus zero for imul. |
| 4946 mul->AssumeRepresentation(Representation::Integer32()); | 4910 mul->AssumeRepresentation(Representation::Integer32()); |
| 4947 mul->ClearFlag(HValue::kCanOverflow); | 4911 mul->ClearFlag(HValue::kCanOverflow); |
| 4948 return mul; | 4912 return mul; |
| 4949 } | 4913 } |
| 4950 | 4914 |
| 4951 HValue* Canonicalize() OVERRIDE; | 4915 HValue* Canonicalize() OVERRIDE; |
| 4952 | 4916 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4971 private: | 4935 private: |
| 4972 HMul(HValue* context, HValue* left, HValue* right) | 4936 HMul(HValue* context, HValue* left, HValue* right) |
| 4973 : HArithmeticBinaryOperation(context, left, right) { | 4937 : HArithmeticBinaryOperation(context, left, right) { |
| 4974 SetFlag(kCanOverflow); | 4938 SetFlag(kCanOverflow); |
| 4975 } | 4939 } |
| 4976 }; | 4940 }; |
| 4977 | 4941 |
| 4978 | 4942 |
| 4979 class HMod FINAL : public HArithmeticBinaryOperation { | 4943 class HMod FINAL : public HArithmeticBinaryOperation { |
| 4980 public: | 4944 public: |
| 4981 static HInstruction* New(Zone* zone, | 4945 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 4982 HValue* context, | 4946 HValue* left, HValue* right); |
| 4983 HValue* left, | |
| 4984 HValue* right); | |
| 4985 | 4947 |
| 4986 HValue* Canonicalize() OVERRIDE; | 4948 HValue* Canonicalize() OVERRIDE; |
| 4987 | 4949 |
| 4988 virtual void UpdateRepresentation(Representation new_rep, | 4950 virtual void UpdateRepresentation(Representation new_rep, |
| 4989 HInferRepresentationPhase* h_infer, | 4951 HInferRepresentationPhase* h_infer, |
| 4990 const char* reason) OVERRIDE { | 4952 const char* reason) OVERRIDE { |
| 4991 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); | 4953 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); |
| 4992 HArithmeticBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | 4954 HArithmeticBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); |
| 4993 } | 4955 } |
| 4994 | 4956 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5005 HValue* right) : HArithmeticBinaryOperation(context, left, right) { | 4967 HValue* right) : HArithmeticBinaryOperation(context, left, right) { |
| 5006 SetFlag(kCanBeDivByZero); | 4968 SetFlag(kCanBeDivByZero); |
| 5007 SetFlag(kCanOverflow); | 4969 SetFlag(kCanOverflow); |
| 5008 SetFlag(kLeftCanBeNegative); | 4970 SetFlag(kLeftCanBeNegative); |
| 5009 } | 4971 } |
| 5010 }; | 4972 }; |
| 5011 | 4973 |
| 5012 | 4974 |
| 5013 class HDiv FINAL : public HArithmeticBinaryOperation { | 4975 class HDiv FINAL : public HArithmeticBinaryOperation { |
| 5014 public: | 4976 public: |
| 5015 static HInstruction* New(Zone* zone, | 4977 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 5016 HValue* context, | 4978 HValue* left, HValue* right); |
| 5017 HValue* left, | |
| 5018 HValue* right); | |
| 5019 | 4979 |
| 5020 HValue* Canonicalize() OVERRIDE; | 4980 HValue* Canonicalize() OVERRIDE; |
| 5021 | 4981 |
| 5022 virtual void UpdateRepresentation(Representation new_rep, | 4982 virtual void UpdateRepresentation(Representation new_rep, |
| 5023 HInferRepresentationPhase* h_infer, | 4983 HInferRepresentationPhase* h_infer, |
| 5024 const char* reason) OVERRIDE { | 4984 const char* reason) OVERRIDE { |
| 5025 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); | 4985 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); |
| 5026 HArithmeticBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | 4986 HArithmeticBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); |
| 5027 } | 4987 } |
| 5028 | 4988 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5039 SetFlag(kCanBeDivByZero); | 4999 SetFlag(kCanBeDivByZero); |
| 5040 SetFlag(kCanOverflow); | 5000 SetFlag(kCanOverflow); |
| 5041 } | 5001 } |
| 5042 }; | 5002 }; |
| 5043 | 5003 |
| 5044 | 5004 |
| 5045 class HMathMinMax FINAL : public HArithmeticBinaryOperation { | 5005 class HMathMinMax FINAL : public HArithmeticBinaryOperation { |
| 5046 public: | 5006 public: |
| 5047 enum Operation { kMathMin, kMathMax }; | 5007 enum Operation { kMathMin, kMathMax }; |
| 5048 | 5008 |
| 5049 static HInstruction* New(Zone* zone, | 5009 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 5050 HValue* context, | 5010 HValue* left, HValue* right, Operation op); |
| 5051 HValue* left, | |
| 5052 HValue* right, | |
| 5053 Operation op); | |
| 5054 | 5011 |
| 5055 Representation observed_input_representation(int index) OVERRIDE { | 5012 Representation observed_input_representation(int index) OVERRIDE { |
| 5056 return RequiredInputRepresentation(index); | 5013 return RequiredInputRepresentation(index); |
| 5057 } | 5014 } |
| 5058 | 5015 |
| 5059 virtual void InferRepresentation( | 5016 virtual void InferRepresentation( |
| 5060 HInferRepresentationPhase* h_infer) OVERRIDE; | 5017 HInferRepresentationPhase* h_infer) OVERRIDE; |
| 5061 | 5018 |
| 5062 Representation RepresentationFromInputs() OVERRIDE { | 5019 Representation RepresentationFromInputs() OVERRIDE { |
| 5063 Representation left_rep = left()->representation(); | 5020 Representation left_rep = left()->representation(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 5087 HMathMinMax(HValue* context, HValue* left, HValue* right, Operation op) | 5044 HMathMinMax(HValue* context, HValue* left, HValue* right, Operation op) |
| 5088 : HArithmeticBinaryOperation(context, left, right), | 5045 : HArithmeticBinaryOperation(context, left, right), |
| 5089 operation_(op) { } | 5046 operation_(op) { } |
| 5090 | 5047 |
| 5091 Operation operation_; | 5048 Operation operation_; |
| 5092 }; | 5049 }; |
| 5093 | 5050 |
| 5094 | 5051 |
| 5095 class HBitwise FINAL : public HBitwiseBinaryOperation { | 5052 class HBitwise FINAL : public HBitwiseBinaryOperation { |
| 5096 public: | 5053 public: |
| 5097 static HInstruction* New(Zone* zone, | 5054 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 5098 HValue* context, | 5055 Token::Value op, HValue* left, HValue* right); |
| 5099 Token::Value op, | |
| 5100 HValue* left, | |
| 5101 HValue* right); | |
| 5102 | 5056 |
| 5103 Token::Value op() const { return op_; } | 5057 Token::Value op() const { return op_; } |
| 5104 | 5058 |
| 5105 bool IsCommutative() const OVERRIDE { return true; } | 5059 bool IsCommutative() const OVERRIDE { return true; } |
| 5106 | 5060 |
| 5107 HValue* Canonicalize() OVERRIDE; | 5061 HValue* Canonicalize() OVERRIDE; |
| 5108 | 5062 |
| 5109 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 5063 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
| 5110 | 5064 |
| 5111 DECLARE_CONCRETE_INSTRUCTION(Bitwise) | 5065 DECLARE_CONCRETE_INSTRUCTION(Bitwise) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5149 SetFlag(kTruncatingToInt32); | 5103 SetFlag(kTruncatingToInt32); |
| 5150 } | 5104 } |
| 5151 } | 5105 } |
| 5152 | 5106 |
| 5153 Token::Value op_; | 5107 Token::Value op_; |
| 5154 }; | 5108 }; |
| 5155 | 5109 |
| 5156 | 5110 |
| 5157 class HShl FINAL : public HBitwiseBinaryOperation { | 5111 class HShl FINAL : public HBitwiseBinaryOperation { |
| 5158 public: | 5112 public: |
| 5159 static HInstruction* New(Zone* zone, | 5113 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 5160 HValue* context, | 5114 HValue* left, HValue* right); |
| 5161 HValue* left, | |
| 5162 HValue* right); | |
| 5163 | 5115 |
| 5164 Range* InferRange(Zone* zone) OVERRIDE; | 5116 Range* InferRange(Zone* zone) OVERRIDE; |
| 5165 | 5117 |
| 5166 virtual void UpdateRepresentation(Representation new_rep, | 5118 virtual void UpdateRepresentation(Representation new_rep, |
| 5167 HInferRepresentationPhase* h_infer, | 5119 HInferRepresentationPhase* h_infer, |
| 5168 const char* reason) OVERRIDE { | 5120 const char* reason) OVERRIDE { |
| 5169 if (new_rep.IsSmi() && | 5121 if (new_rep.IsSmi() && |
| 5170 !(right()->IsInteger32Constant() && | 5122 !(right()->IsInteger32Constant() && |
| 5171 right()->GetInteger32Constant() >= 0)) { | 5123 right()->GetInteger32Constant() >= 0)) { |
| 5172 new_rep = Representation::Integer32(); | 5124 new_rep = Representation::Integer32(); |
| 5173 } | 5125 } |
| 5174 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | 5126 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); |
| 5175 } | 5127 } |
| 5176 | 5128 |
| 5177 DECLARE_CONCRETE_INSTRUCTION(Shl) | 5129 DECLARE_CONCRETE_INSTRUCTION(Shl) |
| 5178 | 5130 |
| 5179 protected: | 5131 protected: |
| 5180 bool DataEquals(HValue* other) OVERRIDE { return true; } | 5132 bool DataEquals(HValue* other) OVERRIDE { return true; } |
| 5181 | 5133 |
| 5182 private: | 5134 private: |
| 5183 HShl(HValue* context, HValue* left, HValue* right) | 5135 HShl(HValue* context, HValue* left, HValue* right) |
| 5184 : HBitwiseBinaryOperation(context, left, right) { } | 5136 : HBitwiseBinaryOperation(context, left, right) { } |
| 5185 }; | 5137 }; |
| 5186 | 5138 |
| 5187 | 5139 |
| 5188 class HShr FINAL : public HBitwiseBinaryOperation { | 5140 class HShr FINAL : public HBitwiseBinaryOperation { |
| 5189 public: | 5141 public: |
| 5190 static HInstruction* New(Zone* zone, | 5142 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 5191 HValue* context, | 5143 HValue* left, HValue* right); |
| 5192 HValue* left, | |
| 5193 HValue* right); | |
| 5194 | 5144 |
| 5195 bool TryDecompose(DecompositionResult* decomposition) OVERRIDE { | 5145 bool TryDecompose(DecompositionResult* decomposition) OVERRIDE { |
| 5196 if (right()->IsInteger32Constant()) { | 5146 if (right()->IsInteger32Constant()) { |
| 5197 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) { | 5147 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) { |
| 5198 // This is intended to look for HAdd and HSub, to handle compounds | 5148 // This is intended to look for HAdd and HSub, to handle compounds |
| 5199 // like ((base + offset) >> scale) with one single decomposition. | 5149 // like ((base + offset) >> scale) with one single decomposition. |
| 5200 left()->TryDecompose(decomposition); | 5150 left()->TryDecompose(decomposition); |
| 5201 return true; | 5151 return true; |
| 5202 } | 5152 } |
| 5203 } | 5153 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5219 bool DataEquals(HValue* other) OVERRIDE { return true; } | 5169 bool DataEquals(HValue* other) OVERRIDE { return true; } |
| 5220 | 5170 |
| 5221 private: | 5171 private: |
| 5222 HShr(HValue* context, HValue* left, HValue* right) | 5172 HShr(HValue* context, HValue* left, HValue* right) |
| 5223 : HBitwiseBinaryOperation(context, left, right) { } | 5173 : HBitwiseBinaryOperation(context, left, right) { } |
| 5224 }; | 5174 }; |
| 5225 | 5175 |
| 5226 | 5176 |
| 5227 class HSar FINAL : public HBitwiseBinaryOperation { | 5177 class HSar FINAL : public HBitwiseBinaryOperation { |
| 5228 public: | 5178 public: |
| 5229 static HInstruction* New(Zone* zone, | 5179 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 5230 HValue* context, | 5180 HValue* left, HValue* right); |
| 5231 HValue* left, | |
| 5232 HValue* right); | |
| 5233 | 5181 |
| 5234 bool TryDecompose(DecompositionResult* decomposition) OVERRIDE { | 5182 bool TryDecompose(DecompositionResult* decomposition) OVERRIDE { |
| 5235 if (right()->IsInteger32Constant()) { | 5183 if (right()->IsInteger32Constant()) { |
| 5236 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) { | 5184 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) { |
| 5237 // This is intended to look for HAdd and HSub, to handle compounds | 5185 // This is intended to look for HAdd and HSub, to handle compounds |
| 5238 // like ((base + offset) >> scale) with one single decomposition. | 5186 // like ((base + offset) >> scale) with one single decomposition. |
| 5239 left()->TryDecompose(decomposition); | 5187 left()->TryDecompose(decomposition); |
| 5240 return true; | 5188 return true; |
| 5241 } | 5189 } |
| 5242 } | 5190 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5258 bool DataEquals(HValue* other) OVERRIDE { return true; } | 5206 bool DataEquals(HValue* other) OVERRIDE { return true; } |
| 5259 | 5207 |
| 5260 private: | 5208 private: |
| 5261 HSar(HValue* context, HValue* left, HValue* right) | 5209 HSar(HValue* context, HValue* left, HValue* right) |
| 5262 : HBitwiseBinaryOperation(context, left, right) { } | 5210 : HBitwiseBinaryOperation(context, left, right) { } |
| 5263 }; | 5211 }; |
| 5264 | 5212 |
| 5265 | 5213 |
| 5266 class HRor FINAL : public HBitwiseBinaryOperation { | 5214 class HRor FINAL : public HBitwiseBinaryOperation { |
| 5267 public: | 5215 public: |
| 5268 static HInstruction* New(Zone* zone, | 5216 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 5269 HValue* context, | 5217 HValue* left, HValue* right) { |
| 5270 HValue* left, | |
| 5271 HValue* right) { | |
| 5272 return new(zone) HRor(context, left, right); | 5218 return new(zone) HRor(context, left, right); |
| 5273 } | 5219 } |
| 5274 | 5220 |
| 5275 virtual void UpdateRepresentation(Representation new_rep, | 5221 virtual void UpdateRepresentation(Representation new_rep, |
| 5276 HInferRepresentationPhase* h_infer, | 5222 HInferRepresentationPhase* h_infer, |
| 5277 const char* reason) OVERRIDE { | 5223 const char* reason) OVERRIDE { |
| 5278 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); | 5224 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); |
| 5279 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | 5225 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); |
| 5280 } | 5226 } |
| 5281 | 5227 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5597 | 5543 |
| 5598 | 5544 |
| 5599 class HAllocate FINAL : public HTemplateInstruction<2> { | 5545 class HAllocate FINAL : public HTemplateInstruction<2> { |
| 5600 public: | 5546 public: |
| 5601 static bool CompatibleInstanceTypes(InstanceType type1, | 5547 static bool CompatibleInstanceTypes(InstanceType type1, |
| 5602 InstanceType type2) { | 5548 InstanceType type2) { |
| 5603 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && | 5549 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && |
| 5604 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); | 5550 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); |
| 5605 } | 5551 } |
| 5606 | 5552 |
| 5607 static HAllocate* New(Zone* zone, | 5553 static HAllocate* New( |
| 5608 HValue* context, | 5554 Isolate* isolate, Zone* zone, HValue* context, HValue* size, HType type, |
| 5609 HValue* size, | 5555 PretenureFlag pretenure_flag, InstanceType instance_type, |
| 5610 HType type, | 5556 Handle<AllocationSite> allocation_site = Handle<AllocationSite>::null()) { |
| 5611 PretenureFlag pretenure_flag, | |
| 5612 InstanceType instance_type, | |
| 5613 Handle<AllocationSite> allocation_site = | |
| 5614 Handle<AllocationSite>::null()) { | |
| 5615 return new(zone) HAllocate(context, size, type, pretenure_flag, | 5557 return new(zone) HAllocate(context, size, type, pretenure_flag, |
| 5616 instance_type, allocation_site); | 5558 instance_type, allocation_site); |
| 5617 } | 5559 } |
| 5618 | 5560 |
| 5619 // Maximum instance size for which allocations will be inlined. | 5561 // Maximum instance size for which allocations will be inlined. |
| 5620 static const int kMaxInlineSize = 64 * kPointerSize; | 5562 static const int kMaxInlineSize = 64 * kPointerSize; |
| 5621 | 5563 |
| 5622 HValue* context() const { return OperandAt(0); } | 5564 HValue* context() const { return OperandAt(0); } |
| 5623 HValue* size() const { return OperandAt(1); } | 5565 HValue* size() const { return OperandAt(1); } |
| 5624 | 5566 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5779 Flags flags_; | 5721 Flags flags_; |
| 5780 Handle<Map> known_initial_map_; | 5722 Handle<Map> known_initial_map_; |
| 5781 HAllocate* dominating_allocate_; | 5723 HAllocate* dominating_allocate_; |
| 5782 HStoreNamedField* filler_free_space_size_; | 5724 HStoreNamedField* filler_free_space_size_; |
| 5783 HConstant* size_upper_bound_; | 5725 HConstant* size_upper_bound_; |
| 5784 }; | 5726 }; |
| 5785 | 5727 |
| 5786 | 5728 |
| 5787 class HStoreCodeEntry FINAL: public HTemplateInstruction<2> { | 5729 class HStoreCodeEntry FINAL: public HTemplateInstruction<2> { |
| 5788 public: | 5730 public: |
| 5789 static HStoreCodeEntry* New(Zone* zone, | 5731 static HStoreCodeEntry* New(Isolate* isolate, Zone* zone, HValue* context, |
| 5790 HValue* context, | 5732 HValue* function, HValue* code) { |
| 5791 HValue* function, | |
| 5792 HValue* code) { | |
| 5793 return new(zone) HStoreCodeEntry(function, code); | 5733 return new(zone) HStoreCodeEntry(function, code); |
| 5794 } | 5734 } |
| 5795 | 5735 |
| 5796 Representation RequiredInputRepresentation(int index) OVERRIDE { | 5736 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 5797 return Representation::Tagged(); | 5737 return Representation::Tagged(); |
| 5798 } | 5738 } |
| 5799 | 5739 |
| 5800 HValue* function() { return OperandAt(0); } | 5740 HValue* function() { return OperandAt(0); } |
| 5801 HValue* code_object() { return OperandAt(1); } | 5741 HValue* code_object() { return OperandAt(1); } |
| 5802 | 5742 |
| 5803 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry) | 5743 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry) |
| 5804 | 5744 |
| 5805 private: | 5745 private: |
| 5806 HStoreCodeEntry(HValue* function, HValue* code) { | 5746 HStoreCodeEntry(HValue* function, HValue* code) { |
| 5807 SetOperandAt(0, function); | 5747 SetOperandAt(0, function); |
| 5808 SetOperandAt(1, code); | 5748 SetOperandAt(1, code); |
| 5809 } | 5749 } |
| 5810 }; | 5750 }; |
| 5811 | 5751 |
| 5812 | 5752 |
| 5813 class HInnerAllocatedObject FINAL : public HTemplateInstruction<2> { | 5753 class HInnerAllocatedObject FINAL : public HTemplateInstruction<2> { |
| 5814 public: | 5754 public: |
| 5815 static HInnerAllocatedObject* New(Zone* zone, | 5755 static HInnerAllocatedObject* New(Isolate* isolate, Zone* zone, |
| 5816 HValue* context, | 5756 HValue* context, HValue* value, |
| 5817 HValue* value, | 5757 HValue* offset, HType type) { |
| 5818 HValue* offset, | |
| 5819 HType type) { | |
| 5820 return new(zone) HInnerAllocatedObject(value, offset, type); | 5758 return new(zone) HInnerAllocatedObject(value, offset, type); |
| 5821 } | 5759 } |
| 5822 | 5760 |
| 5823 HValue* base_object() const { return OperandAt(0); } | 5761 HValue* base_object() const { return OperandAt(0); } |
| 5824 HValue* offset() const { return OperandAt(1); } | 5762 HValue* offset() const { return OperandAt(1); } |
| 5825 | 5763 |
| 5826 Representation RequiredInputRepresentation(int index) OVERRIDE { | 5764 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 5827 return index == 0 ? Representation::Tagged() : Representation::Integer32(); | 5765 return index == 0 ? Representation::Tagged() : Representation::Integer32(); |
| 5828 } | 5766 } |
| 5829 | 5767 |
| (...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7346 SetOperandAt(3, context); | 7284 SetOperandAt(3, context); |
| 7347 SetAllSideEffects(); | 7285 SetAllSideEffects(); |
| 7348 } | 7286 } |
| 7349 | 7287 |
| 7350 StrictMode strict_mode_; | 7288 StrictMode strict_mode_; |
| 7351 }; | 7289 }; |
| 7352 | 7290 |
| 7353 | 7291 |
| 7354 class HTransitionElementsKind FINAL : public HTemplateInstruction<2> { | 7292 class HTransitionElementsKind FINAL : public HTemplateInstruction<2> { |
| 7355 public: | 7293 public: |
| 7356 inline static HTransitionElementsKind* New(Zone* zone, | 7294 inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone, |
| 7357 HValue* context, | 7295 HValue* context, HValue* object, |
| 7358 HValue* object, | |
| 7359 Handle<Map> original_map, | 7296 Handle<Map> original_map, |
| 7360 Handle<Map> transitioned_map) { | 7297 Handle<Map> transitioned_map) { |
| 7361 return new(zone) HTransitionElementsKind(context, object, | 7298 return new(zone) HTransitionElementsKind(context, object, |
| 7362 original_map, transitioned_map); | 7299 original_map, transitioned_map); |
| 7363 } | 7300 } |
| 7364 | 7301 |
| 7365 Representation RequiredInputRepresentation(int index) OVERRIDE { | 7302 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 7366 return Representation::Tagged(); | 7303 return Representation::Tagged(); |
| 7367 } | 7304 } |
| 7368 | 7305 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7408 | 7345 |
| 7409 Unique<Map> original_map_; | 7346 Unique<Map> original_map_; |
| 7410 Unique<Map> transitioned_map_; | 7347 Unique<Map> transitioned_map_; |
| 7411 ElementsKind from_kind_; | 7348 ElementsKind from_kind_; |
| 7412 ElementsKind to_kind_; | 7349 ElementsKind to_kind_; |
| 7413 }; | 7350 }; |
| 7414 | 7351 |
| 7415 | 7352 |
| 7416 class HStringAdd FINAL : public HBinaryOperation { | 7353 class HStringAdd FINAL : public HBinaryOperation { |
| 7417 public: | 7354 public: |
| 7418 static HInstruction* New(Zone* zone, | 7355 static HInstruction* New( |
| 7419 HValue* context, | 7356 Isolate* isolate, Zone* zone, HValue* context, HValue* left, |
| 7420 HValue* left, | 7357 HValue* right, PretenureFlag pretenure_flag = NOT_TENURED, |
| 7421 HValue* right, | 7358 StringAddFlags flags = STRING_ADD_CHECK_BOTH, |
| 7422 PretenureFlag pretenure_flag = NOT_TENURED, | 7359 Handle<AllocationSite> allocation_site = Handle<AllocationSite>::null()); |
| 7423 StringAddFlags flags = STRING_ADD_CHECK_BOTH, | |
| 7424 Handle<AllocationSite> allocation_site = | |
| 7425 Handle<AllocationSite>::null()); | |
| 7426 | 7360 |
| 7427 StringAddFlags flags() const { return flags_; } | 7361 StringAddFlags flags() const { return flags_; } |
| 7428 PretenureFlag pretenure_flag() const { return pretenure_flag_; } | 7362 PretenureFlag pretenure_flag() const { return pretenure_flag_; } |
| 7429 | 7363 |
| 7430 Representation RequiredInputRepresentation(int index) OVERRIDE { | 7364 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 7431 return Representation::Tagged(); | 7365 return Representation::Tagged(); |
| 7432 } | 7366 } |
| 7433 | 7367 |
| 7434 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 7368 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
| 7435 | 7369 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7509 SetChangesFlag(kNewSpacePromotion); | 7443 SetChangesFlag(kNewSpacePromotion); |
| 7510 } | 7444 } |
| 7511 | 7445 |
| 7512 // No side effects: runtime function assumes string + number inputs. | 7446 // No side effects: runtime function assumes string + number inputs. |
| 7513 bool IsDeletable() const OVERRIDE { return true; } | 7447 bool IsDeletable() const OVERRIDE { return true; } |
| 7514 }; | 7448 }; |
| 7515 | 7449 |
| 7516 | 7450 |
| 7517 class HStringCharFromCode FINAL : public HTemplateInstruction<2> { | 7451 class HStringCharFromCode FINAL : public HTemplateInstruction<2> { |
| 7518 public: | 7452 public: |
| 7519 static HInstruction* New(Zone* zone, | 7453 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 7520 HValue* context, | |
| 7521 HValue* char_code); | 7454 HValue* char_code); |
| 7522 | 7455 |
| 7523 Representation RequiredInputRepresentation(int index) OVERRIDE { | 7456 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 7524 return index == 0 | 7457 return index == 0 |
| 7525 ? Representation::Tagged() | 7458 ? Representation::Tagged() |
| 7526 : Representation::Integer32(); | 7459 : Representation::Integer32(); |
| 7527 } | 7460 } |
| 7528 | 7461 |
| 7529 HValue* context() const { return OperandAt(0); } | 7462 HValue* context() const { return OperandAt(0); } |
| 7530 HValue* value() const { return OperandAt(1); } | 7463 HValue* value() const { return OperandAt(1); } |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7760 : HUnaryOperation(date), index_(index) { | 7693 : HUnaryOperation(date), index_(index) { |
| 7761 set_representation(Representation::Tagged()); | 7694 set_representation(Representation::Tagged()); |
| 7762 } | 7695 } |
| 7763 | 7696 |
| 7764 Smi* index_; | 7697 Smi* index_; |
| 7765 }; | 7698 }; |
| 7766 | 7699 |
| 7767 | 7700 |
| 7768 class HSeqStringGetChar FINAL : public HTemplateInstruction<2> { | 7701 class HSeqStringGetChar FINAL : public HTemplateInstruction<2> { |
| 7769 public: | 7702 public: |
| 7770 static HInstruction* New(Zone* zone, | 7703 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
| 7771 HValue* context, | 7704 String::Encoding encoding, HValue* string, |
| 7772 String::Encoding encoding, | |
| 7773 HValue* string, | |
| 7774 HValue* index); | 7705 HValue* index); |
| 7775 | 7706 |
| 7776 Representation RequiredInputRepresentation(int index) OVERRIDE { | 7707 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 7777 return (index == 0) ? Representation::Tagged() | 7708 return (index == 0) ? Representation::Tagged() |
| 7778 : Representation::Integer32(); | 7709 : Representation::Integer32(); |
| 7779 } | 7710 } |
| 7780 | 7711 |
| 7781 String::Encoding encoding() const { return encoding_; } | 7712 String::Encoding encoding() const { return encoding_; } |
| 7782 HValue* string() const { return OperandAt(0); } | 7713 HValue* string() const { return OperandAt(0); } |
| 7783 HValue* index() const { return OperandAt(1); } | 7714 HValue* index() const { return OperandAt(1); } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8044 }; | 7975 }; |
| 8045 | 7976 |
| 8046 | 7977 |
| 8047 | 7978 |
| 8048 #undef DECLARE_INSTRUCTION | 7979 #undef DECLARE_INSTRUCTION |
| 8049 #undef DECLARE_CONCRETE_INSTRUCTION | 7980 #undef DECLARE_CONCRETE_INSTRUCTION |
| 8050 | 7981 |
| 8051 } } // namespace v8::internal | 7982 } } // namespace v8::internal |
| 8052 | 7983 |
| 8053 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7984 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |