| OLD | NEW | 
|     1 // Copyright 2012 the V8 project authors. All rights reserved. |     1 // Copyright 2012 the V8 project authors. All rights reserved. | 
|     2 // Redistribution and use in source and binary forms, with or without |     2 // Redistribution and use in source and binary forms, with or without | 
|     3 // modification, are permitted provided that the following conditions are |     3 // modification, are permitted provided that the following conditions are | 
|     4 // met: |     4 // met: | 
|     5 // |     5 // | 
|     6 //     * Redistributions of source code must retain the above copyright |     6 //     * Redistributions of source code must retain the above copyright | 
|     7 //       notice, this list of conditions and the following disclaimer. |     7 //       notice, this list of conditions and the following disclaimer. | 
|     8 //     * Redistributions in binary form must reproduce the above |     8 //     * Redistributions in binary form must reproduce the above | 
|     9 //       copyright notice, this list of conditions and the following |     9 //       copyright notice, this list of conditions and the following | 
|    10 //       disclaimer in the documentation and/or other materials provided |    10 //       disclaimer in the documentation and/or other materials provided | 
| (...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1216           bool is_truncating, |  1216           bool is_truncating, | 
|  1217           bool deoptimize_on_undefined) |  1217           bool deoptimize_on_undefined) | 
|  1218       : HUnaryOperation(value) { |  1218       : HUnaryOperation(value) { | 
|  1219     ASSERT(!value->representation().IsNone() && !to.IsNone()); |  1219     ASSERT(!value->representation().IsNone() && !to.IsNone()); | 
|  1220     ASSERT(!value->representation().Equals(to)); |  1220     ASSERT(!value->representation().Equals(to)); | 
|  1221     set_representation(to); |  1221     set_representation(to); | 
|  1222     set_type(HType::TaggedNumber()); |  1222     set_type(HType::TaggedNumber()); | 
|  1223     SetFlag(kUseGVN); |  1223     SetFlag(kUseGVN); | 
|  1224     if (deoptimize_on_undefined) SetFlag(kDeoptimizeOnUndefined); |  1224     if (deoptimize_on_undefined) SetFlag(kDeoptimizeOnUndefined); | 
|  1225     if (is_truncating) SetFlag(kTruncatingToInt32); |  1225     if (is_truncating) SetFlag(kTruncatingToInt32); | 
 |  1226     if (to.IsTagged()) SetGVNFlag(kChangesNewSpacePromotion); | 
|  1226   } |  1227   } | 
|  1227  |  1228  | 
|  1228   virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |  1229   virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 
|  1229   virtual HType CalculateInferredType(); |  1230   virtual HType CalculateInferredType(); | 
|  1230   virtual HValue* Canonicalize(); |  1231   virtual HValue* Canonicalize(); | 
|  1231  |  1232  | 
|  1232   Representation from() { return value()->representation(); } |  1233   Representation from() { return value()->representation(); } | 
|  1233   Representation to() { return representation(); } |  1234   Representation to() { return representation(); } | 
|  1234   bool deoptimize_on_undefined() const { |  1235   bool deoptimize_on_undefined() const { | 
|  1235     return CheckFlag(kDeoptimizeOnUndefined); |  1236     return CheckFlag(kDeoptimizeOnUndefined); | 
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1341  |  1342  | 
|  1342 class HStackCheck: public HTemplateInstruction<1> { |  1343 class HStackCheck: public HTemplateInstruction<1> { | 
|  1343  public: |  1344  public: | 
|  1344   enum Type { |  1345   enum Type { | 
|  1345     kFunctionEntry, |  1346     kFunctionEntry, | 
|  1346     kBackwardsBranch |  1347     kBackwardsBranch | 
|  1347   }; |  1348   }; | 
|  1348  |  1349  | 
|  1349   HStackCheck(HValue* context, Type type) : type_(type) { |  1350   HStackCheck(HValue* context, Type type) : type_(type) { | 
|  1350     SetOperandAt(0, context); |  1351     SetOperandAt(0, context); | 
 |  1352     SetGVNFlag(kChangesNewSpacePromotion); | 
|  1351   } |  1353   } | 
|  1352  |  1354  | 
|  1353   HValue* context() { return OperandAt(0); } |  1355   HValue* context() { return OperandAt(0); } | 
|  1354  |  1356  | 
|  1355   virtual Representation RequiredInputRepresentation(int index) { |  1357   virtual Representation RequiredInputRepresentation(int index) { | 
|  1356     return Representation::Tagged(); |  1358     return Representation::Tagged(); | 
|  1357   } |  1359   } | 
|  1358  |  1360  | 
|  1359   void Eliminate() { |  1361   void Eliminate() { | 
|  1360     // The stack check eliminator might try to eliminate the same stack |  1362     // The stack check eliminator might try to eliminate the same stack | 
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1919     SetOperandAt(1, value); |  1921     SetOperandAt(1, value); | 
|  1920     switch (op) { |  1922     switch (op) { | 
|  1921       case kMathFloor: |  1923       case kMathFloor: | 
|  1922       case kMathRound: |  1924       case kMathRound: | 
|  1923       case kMathCeil: |  1925       case kMathCeil: | 
|  1924         set_representation(Representation::Integer32()); |  1926         set_representation(Representation::Integer32()); | 
|  1925         break; |  1927         break; | 
|  1926       case kMathAbs: |  1928       case kMathAbs: | 
|  1927         set_representation(Representation::Tagged()); |  1929         set_representation(Representation::Tagged()); | 
|  1928         SetFlag(kFlexibleRepresentation); |  1930         SetFlag(kFlexibleRepresentation); | 
 |  1931         SetGVNFlag(kChangesNewSpacePromotion); | 
|  1929         break; |  1932         break; | 
|  1930       case kMathSqrt: |  1933       case kMathSqrt: | 
|  1931       case kMathPowHalf: |  1934       case kMathPowHalf: | 
|  1932       case kMathLog: |  1935       case kMathLog: | 
|  1933       case kMathSin: |  1936       case kMathSin: | 
|  1934       case kMathCos: |  1937       case kMathCos: | 
|  1935       case kMathTan: |  1938       case kMathTan: | 
|  1936         set_representation(Representation::Double()); |  1939         set_representation(Representation::Double()); | 
 |  1940         SetGVNFlag(kChangesNewSpacePromotion); | 
|  1937         break; |  1941         break; | 
|  1938       default: |  1942       default: | 
|  1939         UNREACHABLE(); |  1943         UNREACHABLE(); | 
|  1940     } |  1944     } | 
|  1941     SetFlag(kUseGVN); |  1945     SetFlag(kUseGVN); | 
|  1942   } |  1946   } | 
|  1943  |  1947  | 
|  1944   HValue* context() { return OperandAt(0); } |  1948   HValue* context() { return OperandAt(0); } | 
|  1945   HValue* value() { return OperandAt(1); } |  1949   HValue* value() { return OperandAt(1); } | 
|  1946  |  1950  | 
| (...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3147 }; |  3151 }; | 
|  3148  |  3152  | 
|  3149  |  3153  | 
|  3150 class HPower: public HTemplateInstruction<2> { |  3154 class HPower: public HTemplateInstruction<2> { | 
|  3151  public: |  3155  public: | 
|  3152   HPower(HValue* left, HValue* right) { |  3156   HPower(HValue* left, HValue* right) { | 
|  3153     SetOperandAt(0, left); |  3157     SetOperandAt(0, left); | 
|  3154     SetOperandAt(1, right); |  3158     SetOperandAt(1, right); | 
|  3155     set_representation(Representation::Double()); |  3159     set_representation(Representation::Double()); | 
|  3156     SetFlag(kUseGVN); |  3160     SetFlag(kUseGVN); | 
 |  3161     SetGVNFlag(kChangesNewSpacePromotion); | 
|  3157   } |  3162   } | 
|  3158  |  3163  | 
|  3159   HValue* left() { return OperandAt(0); } |  3164   HValue* left() { return OperandAt(0); } | 
|  3160   HValue* right() { return OperandAt(1); } |  3165   HValue* right() { return OperandAt(1); } | 
|  3161  |  3166  | 
|  3162   virtual Representation RequiredInputRepresentation(int index) { |  3167   virtual Representation RequiredInputRepresentation(int index) { | 
|  3163     return index == 0 |  3168     return index == 0 | 
|  3164       ? Representation::Double() |  3169       ? Representation::Double() | 
|  3165       : Representation::None(); |  3170       : Representation::None(); | 
|  3166   } |  3171   } | 
| (...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  4316  public: |  4321  public: | 
|  4317   HTransitionElementsKind(HValue* object, |  4322   HTransitionElementsKind(HValue* object, | 
|  4318                           Handle<Map> original_map, |  4323                           Handle<Map> original_map, | 
|  4319                           Handle<Map> transitioned_map) |  4324                           Handle<Map> transitioned_map) | 
|  4320       : original_map_(original_map), |  4325       : original_map_(original_map), | 
|  4321         transitioned_map_(transitioned_map) { |  4326         transitioned_map_(transitioned_map) { | 
|  4322     SetOperandAt(0, object); |  4327     SetOperandAt(0, object); | 
|  4323     SetFlag(kUseGVN); |  4328     SetFlag(kUseGVN); | 
|  4324     SetGVNFlag(kChangesElementsKind); |  4329     SetGVNFlag(kChangesElementsKind); | 
|  4325     SetGVNFlag(kChangesElementsPointer); |  4330     SetGVNFlag(kChangesElementsPointer); | 
 |  4331     SetGVNFlag(kChangesNewSpacePromotion); | 
|  4326     set_representation(Representation::Tagged()); |  4332     set_representation(Representation::Tagged()); | 
|  4327   } |  4333   } | 
|  4328  |  4334  | 
|  4329   virtual Representation RequiredInputRepresentation(int index) { |  4335   virtual Representation RequiredInputRepresentation(int index) { | 
|  4330     return Representation::Tagged(); |  4336     return Representation::Tagged(); | 
|  4331   } |  4337   } | 
|  4332  |  4338  | 
|  4333   HValue* object() { return OperandAt(0); } |  4339   HValue* object() { return OperandAt(0); } | 
|  4334   Handle<Map> original_map() { return original_map_; } |  4340   Handle<Map> original_map() { return original_map_; } | 
|  4335   Handle<Map> transitioned_map() { return transitioned_map_; } |  4341   Handle<Map> transitioned_map() { return transitioned_map_; } | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  4377  |  4383  | 
|  4378 class HStringCharCodeAt: public HTemplateInstruction<3> { |  4384 class HStringCharCodeAt: public HTemplateInstruction<3> { | 
|  4379  public: |  4385  public: | 
|  4380   HStringCharCodeAt(HValue* context, HValue* string, HValue* index) { |  4386   HStringCharCodeAt(HValue* context, HValue* string, HValue* index) { | 
|  4381     SetOperandAt(0, context); |  4387     SetOperandAt(0, context); | 
|  4382     SetOperandAt(1, string); |  4388     SetOperandAt(1, string); | 
|  4383     SetOperandAt(2, index); |  4389     SetOperandAt(2, index); | 
|  4384     set_representation(Representation::Integer32()); |  4390     set_representation(Representation::Integer32()); | 
|  4385     SetFlag(kUseGVN); |  4391     SetFlag(kUseGVN); | 
|  4386     SetGVNFlag(kDependsOnMaps); |  4392     SetGVNFlag(kDependsOnMaps); | 
 |  4393     SetGVNFlag(kChangesNewSpacePromotion); | 
|  4387   } |  4394   } | 
|  4388  |  4395  | 
|  4389   virtual Representation RequiredInputRepresentation(int index) { |  4396   virtual Representation RequiredInputRepresentation(int index) { | 
|  4390     // The index is supposed to be Integer32. |  4397     // The index is supposed to be Integer32. | 
|  4391     return index == 2 |  4398     return index == 2 | 
|  4392         ? Representation::Integer32() |  4399         ? Representation::Integer32() | 
|  4393         : Representation::Tagged(); |  4400         : Representation::Tagged(); | 
|  4394   } |  4401   } | 
|  4395  |  4402  | 
|  4396   HValue* context() { return OperandAt(0); } |  4403   HValue* context() { return OperandAt(0); } | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
|  4408 }; |  4415 }; | 
|  4409  |  4416  | 
|  4410  |  4417  | 
|  4411 class HStringCharFromCode: public HTemplateInstruction<2> { |  4418 class HStringCharFromCode: public HTemplateInstruction<2> { | 
|  4412  public: |  4419  public: | 
|  4413   HStringCharFromCode(HValue* context, HValue* char_code) { |  4420   HStringCharFromCode(HValue* context, HValue* char_code) { | 
|  4414     SetOperandAt(0, context); |  4421     SetOperandAt(0, context); | 
|  4415     SetOperandAt(1, char_code); |  4422     SetOperandAt(1, char_code); | 
|  4416     set_representation(Representation::Tagged()); |  4423     set_representation(Representation::Tagged()); | 
|  4417     SetFlag(kUseGVN); |  4424     SetFlag(kUseGVN); | 
 |  4425     SetGVNFlag(kChangesNewSpacePromotion); | 
|  4418   } |  4426   } | 
|  4419  |  4427  | 
|  4420   virtual Representation RequiredInputRepresentation(int index) { |  4428   virtual Representation RequiredInputRepresentation(int index) { | 
|  4421     return index == 0 |  4429     return index == 0 | 
|  4422         ? Representation::Tagged() |  4430         ? Representation::Tagged() | 
|  4423         : Representation::Integer32(); |  4431         : Representation::Integer32(); | 
|  4424   } |  4432   } | 
|  4425   virtual HType CalculateInferredType(); |  4433   virtual HType CalculateInferredType(); | 
|  4426  |  4434  | 
|  4427   HValue* context() { return OperandAt(0); } |  4435   HValue* context() { return OperandAt(0); } | 
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  4509  public: |  4517  public: | 
|  4510   HFastLiteral(HValue* context, |  4518   HFastLiteral(HValue* context, | 
|  4511                Handle<JSObject> boilerplate, |  4519                Handle<JSObject> boilerplate, | 
|  4512                int total_size, |  4520                int total_size, | 
|  4513                int literal_index, |  4521                int literal_index, | 
|  4514                int depth) |  4522                int depth) | 
|  4515       : HMaterializedLiteral<1>(literal_index, depth), |  4523       : HMaterializedLiteral<1>(literal_index, depth), | 
|  4516         boilerplate_(boilerplate), |  4524         boilerplate_(boilerplate), | 
|  4517         total_size_(total_size) { |  4525         total_size_(total_size) { | 
|  4518     SetOperandAt(0, context); |  4526     SetOperandAt(0, context); | 
 |  4527     SetGVNFlag(kChangesNewSpacePromotion); | 
|  4519   } |  4528   } | 
|  4520  |  4529  | 
|  4521   // Maximum depth and total number of elements and properties for literal |  4530   // Maximum depth and total number of elements and properties for literal | 
|  4522   // graphs to be considered for fast deep-copying. |  4531   // graphs to be considered for fast deep-copying. | 
|  4523   static const int kMaxLiteralDepth = 3; |  4532   static const int kMaxLiteralDepth = 3; | 
|  4524   static const int kMaxLiteralProperties = 8; |  4533   static const int kMaxLiteralProperties = 8; | 
|  4525  |  4534  | 
|  4526   HValue* context() { return OperandAt(0); } |  4535   HValue* context() { return OperandAt(0); } | 
|  4527   Handle<JSObject> boilerplate() const { return boilerplate_; } |  4536   Handle<JSObject> boilerplate() const { return boilerplate_; } | 
|  4528   int total_size() const { return total_size_; } |  4537   int total_size() const { return total_size_; } | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
|  4544  public: |  4553  public: | 
|  4545   HArrayLiteral(HValue* context, |  4554   HArrayLiteral(HValue* context, | 
|  4546                 Handle<HeapObject> boilerplate_object, |  4555                 Handle<HeapObject> boilerplate_object, | 
|  4547                 int length, |  4556                 int length, | 
|  4548                 int literal_index, |  4557                 int literal_index, | 
|  4549                 int depth) |  4558                 int depth) | 
|  4550       : HMaterializedLiteral<1>(literal_index, depth), |  4559       : HMaterializedLiteral<1>(literal_index, depth), | 
|  4551         length_(length), |  4560         length_(length), | 
|  4552         boilerplate_object_(boilerplate_object) { |  4561         boilerplate_object_(boilerplate_object) { | 
|  4553     SetOperandAt(0, context); |  4562     SetOperandAt(0, context); | 
 |  4563     SetGVNFlag(kChangesNewSpacePromotion); | 
|  4554   } |  4564   } | 
|  4555  |  4565  | 
|  4556   HValue* context() { return OperandAt(0); } |  4566   HValue* context() { return OperandAt(0); } | 
|  4557   ElementsKind boilerplate_elements_kind() const { |  4567   ElementsKind boilerplate_elements_kind() const { | 
|  4558     if (!boilerplate_object_->IsJSObject()) { |  4568     if (!boilerplate_object_->IsJSObject()) { | 
|  4559       return FAST_ELEMENTS; |  4569       return FAST_ELEMENTS; | 
|  4560     } |  4570     } | 
|  4561     return Handle<JSObject>::cast(boilerplate_object_)->GetElementsKind(); |  4571     return Handle<JSObject>::cast(boilerplate_object_)->GetElementsKind(); | 
|  4562   } |  4572   } | 
|  4563   Handle<HeapObject> boilerplate_object() const { return boilerplate_object_; } |  4573   Handle<HeapObject> boilerplate_object() const { return boilerplate_object_; } | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
|  4584                  Handle<FixedArray> constant_properties, |  4594                  Handle<FixedArray> constant_properties, | 
|  4585                  bool fast_elements, |  4595                  bool fast_elements, | 
|  4586                  int literal_index, |  4596                  int literal_index, | 
|  4587                  int depth, |  4597                  int depth, | 
|  4588                  bool has_function) |  4598                  bool has_function) | 
|  4589       : HMaterializedLiteral<1>(literal_index, depth), |  4599       : HMaterializedLiteral<1>(literal_index, depth), | 
|  4590         constant_properties_(constant_properties), |  4600         constant_properties_(constant_properties), | 
|  4591         fast_elements_(fast_elements), |  4601         fast_elements_(fast_elements), | 
|  4592         has_function_(has_function) { |  4602         has_function_(has_function) { | 
|  4593     SetOperandAt(0, context); |  4603     SetOperandAt(0, context); | 
 |  4604     SetGVNFlag(kChangesNewSpacePromotion); | 
|  4594   } |  4605   } | 
|  4595  |  4606  | 
|  4596   HValue* context() { return OperandAt(0); } |  4607   HValue* context() { return OperandAt(0); } | 
|  4597   Handle<FixedArray> constant_properties() const { |  4608   Handle<FixedArray> constant_properties() const { | 
|  4598     return constant_properties_; |  4609     return constant_properties_; | 
|  4599   } |  4610   } | 
|  4600   bool fast_elements() const { return fast_elements_; } |  4611   bool fast_elements() const { return fast_elements_; } | 
|  4601   bool has_function() const { return has_function_; } |  4612   bool has_function() const { return has_function_; } | 
|  4602  |  4613  | 
|  4603   virtual Representation RequiredInputRepresentation(int index) { |  4614   virtual Representation RequiredInputRepresentation(int index) { | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  4645  |  4656  | 
|  4646  |  4657  | 
|  4647 class HFunctionLiteral: public HTemplateInstruction<1> { |  4658 class HFunctionLiteral: public HTemplateInstruction<1> { | 
|  4648  public: |  4659  public: | 
|  4649   HFunctionLiteral(HValue* context, |  4660   HFunctionLiteral(HValue* context, | 
|  4650                    Handle<SharedFunctionInfo> shared, |  4661                    Handle<SharedFunctionInfo> shared, | 
|  4651                    bool pretenure) |  4662                    bool pretenure) | 
|  4652       : shared_info_(shared), pretenure_(pretenure) { |  4663       : shared_info_(shared), pretenure_(pretenure) { | 
|  4653     SetOperandAt(0, context); |  4664     SetOperandAt(0, context); | 
|  4654     set_representation(Representation::Tagged()); |  4665     set_representation(Representation::Tagged()); | 
 |  4666     SetGVNFlag(kChangesNewSpacePromotion); | 
|  4655   } |  4667   } | 
|  4656  |  4668  | 
|  4657   HValue* context() { return OperandAt(0); } |  4669   HValue* context() { return OperandAt(0); } | 
|  4658  |  4670  | 
|  4659   virtual Representation RequiredInputRepresentation(int index) { |  4671   virtual Representation RequiredInputRepresentation(int index) { | 
|  4660     return Representation::Tagged(); |  4672     return Representation::Tagged(); | 
|  4661   } |  4673   } | 
|  4662   virtual HType CalculateInferredType(); |  4674   virtual HType CalculateInferredType(); | 
|  4663  |  4675  | 
|  4664   DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) |  4676   DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) | 
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  4921   DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); |  4933   DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); | 
|  4922 }; |  4934 }; | 
|  4923  |  4935  | 
|  4924  |  4936  | 
|  4925 #undef DECLARE_INSTRUCTION |  4937 #undef DECLARE_INSTRUCTION | 
|  4926 #undef DECLARE_CONCRETE_INSTRUCTION |  4938 #undef DECLARE_CONCRETE_INSTRUCTION | 
|  4927  |  4939  | 
|  4928 } }  // namespace v8::internal |  4940 } }  // namespace v8::internal | 
|  4929  |  4941  | 
|  4930 #endif  // V8_HYDROGEN_INSTRUCTIONS_H_ |  4942 #endif  // V8_HYDROGEN_INSTRUCTIONS_H_ | 
| OLD | NEW |