OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1400 }; | 1400 }; |
1401 | 1401 |
1402 | 1402 |
1403 class HJSArrayLength: public HUnaryOperation { | 1403 class HJSArrayLength: public HUnaryOperation { |
1404 public: | 1404 public: |
1405 explicit HJSArrayLength(HValue* value) : HUnaryOperation(value) { | 1405 explicit HJSArrayLength(HValue* value) : HUnaryOperation(value) { |
1406 // The length of an array is stored as a tagged value in the array | 1406 // The length of an array is stored as a tagged value in the array |
1407 // object. It is guaranteed to be 32 bit integer, but it can be | 1407 // object. It is guaranteed to be 32 bit integer, but it can be |
1408 // represented as either a smi or heap number. | 1408 // represented as either a smi or heap number. |
1409 set_representation(Representation::Tagged()); | 1409 set_representation(Representation::Tagged()); |
| 1410 SetFlag(kUseGVN); |
1410 SetFlag(kDependsOnArrayLengths); | 1411 SetFlag(kDependsOnArrayLengths); |
1411 SetFlag(kUseGVN); | 1412 SetFlag(kDependsOnMaps); |
1412 } | 1413 } |
1413 | 1414 |
1414 virtual Representation RequiredInputRepresentation(int index) const { | 1415 virtual Representation RequiredInputRepresentation(int index) const { |
1415 return Representation::Tagged(); | 1416 return Representation::Tagged(); |
1416 } | 1417 } |
1417 | 1418 |
1418 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js_array_length") | 1419 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js_array_length") |
1419 | 1420 |
1420 protected: | 1421 protected: |
1421 virtual bool DataEquals(HValue* other) { return true; } | 1422 virtual bool DataEquals(HValue* other) { return true; } |
1422 }; | 1423 }; |
1423 | 1424 |
1424 | 1425 |
1425 class HFixedArrayLength: public HUnaryOperation { | 1426 class HFixedArrayLength: public HUnaryOperation { |
1426 public: | 1427 public: |
1427 explicit HFixedArrayLength(HValue* value) : HUnaryOperation(value) { | 1428 explicit HFixedArrayLength(HValue* value) : HUnaryOperation(value) { |
1428 set_representation(Representation::Tagged()); | 1429 set_representation(Representation::Tagged()); |
| 1430 SetFlag(kUseGVN); |
1429 SetFlag(kDependsOnArrayLengths); | 1431 SetFlag(kDependsOnArrayLengths); |
1430 SetFlag(kUseGVN); | |
1431 } | 1432 } |
1432 | 1433 |
1433 virtual Representation RequiredInputRepresentation(int index) const { | 1434 virtual Representation RequiredInputRepresentation(int index) const { |
1434 return Representation::Tagged(); | 1435 return Representation::Tagged(); |
1435 } | 1436 } |
1436 | 1437 |
1437 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed_array_length") | 1438 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed_array_length") |
1438 | 1439 |
1439 protected: | 1440 protected: |
1440 virtual bool DataEquals(HValue* other) { return true; } | 1441 virtual bool DataEquals(HValue* other) { return true; } |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2250 Token::Value token_; | 2251 Token::Value token_; |
2251 }; | 2252 }; |
2252 | 2253 |
2253 | 2254 |
2254 class HCompareJSObjectEq: public HBinaryOperation { | 2255 class HCompareJSObjectEq: public HBinaryOperation { |
2255 public: | 2256 public: |
2256 HCompareJSObjectEq(HValue* left, HValue* right) | 2257 HCompareJSObjectEq(HValue* left, HValue* right) |
2257 : HBinaryOperation(left, right) { | 2258 : HBinaryOperation(left, right) { |
2258 set_representation(Representation::Tagged()); | 2259 set_representation(Representation::Tagged()); |
2259 SetFlag(kUseGVN); | 2260 SetFlag(kUseGVN); |
| 2261 SetFlag(kDependsOnMaps); |
2260 } | 2262 } |
2261 | 2263 |
2262 virtual bool EmitAtUses() { | 2264 virtual bool EmitAtUses() { |
2263 return !HasSideEffects() && (uses()->length() <= 1); | 2265 return !HasSideEffects() && (uses()->length() <= 1); |
2264 } | 2266 } |
2265 | 2267 |
2266 virtual Representation RequiredInputRepresentation(int index) const { | 2268 virtual Representation RequiredInputRepresentation(int index) const { |
2267 return Representation::Tagged(); | 2269 return Representation::Tagged(); |
2268 } | 2270 } |
2269 virtual HType CalculateInferredType(); | 2271 virtual HType CalculateInferredType(); |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2935 | 2937 |
2936 | 2938 |
2937 class HLoadNamedField: public HUnaryOperation { | 2939 class HLoadNamedField: public HUnaryOperation { |
2938 public: | 2940 public: |
2939 HLoadNamedField(HValue* object, bool is_in_object, int offset) | 2941 HLoadNamedField(HValue* object, bool is_in_object, int offset) |
2940 : HUnaryOperation(object), | 2942 : HUnaryOperation(object), |
2941 is_in_object_(is_in_object), | 2943 is_in_object_(is_in_object), |
2942 offset_(offset) { | 2944 offset_(offset) { |
2943 set_representation(Representation::Tagged()); | 2945 set_representation(Representation::Tagged()); |
2944 SetFlag(kUseGVN); | 2946 SetFlag(kUseGVN); |
| 2947 SetFlag(kDependsOnMaps); |
2945 if (is_in_object) { | 2948 if (is_in_object) { |
2946 SetFlag(kDependsOnInobjectFields); | 2949 SetFlag(kDependsOnInobjectFields); |
2947 } else { | 2950 } else { |
2948 SetFlag(kDependsOnBackingStoreFields); | 2951 SetFlag(kDependsOnBackingStoreFields); |
2949 } | 2952 } |
2950 } | 2953 } |
2951 | 2954 |
2952 HValue* object() { return OperandAt(0); } | 2955 HValue* object() { return OperandAt(0); } |
2953 bool is_in_object() const { return is_in_object_; } | 2956 bool is_in_object() const { return is_in_object_; } |
2954 int offset() const { return offset_; } | 2957 int offset() const { return offset_; } |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3261 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic") | 3264 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic") |
3262 }; | 3265 }; |
3263 | 3266 |
3264 | 3267 |
3265 class HStringCharCodeAt: public HBinaryOperation { | 3268 class HStringCharCodeAt: public HBinaryOperation { |
3266 public: | 3269 public: |
3267 HStringCharCodeAt(HValue* string, HValue* index) | 3270 HStringCharCodeAt(HValue* string, HValue* index) |
3268 : HBinaryOperation(string, index) { | 3271 : HBinaryOperation(string, index) { |
3269 set_representation(Representation::Integer32()); | 3272 set_representation(Representation::Integer32()); |
3270 SetFlag(kUseGVN); | 3273 SetFlag(kUseGVN); |
| 3274 SetFlag(kDependsOnMaps); |
3271 } | 3275 } |
3272 | 3276 |
3273 virtual Representation RequiredInputRepresentation(int index) const { | 3277 virtual Representation RequiredInputRepresentation(int index) const { |
3274 // The index is supposed to be Integer32. | 3278 // The index is supposed to be Integer32. |
3275 return (index == 1) ? Representation::Integer32() | 3279 return (index == 1) ? Representation::Integer32() |
3276 : Representation::Tagged(); | 3280 : Representation::Tagged(); |
3277 } | 3281 } |
3278 | 3282 |
3279 HValue* string() { return OperandAt(0); } | 3283 HValue* string() { return OperandAt(0); } |
3280 HValue* index() { return OperandAt(1); } | 3284 HValue* index() { return OperandAt(1); } |
(...skipping 24 matching lines...) Expand all Loading... |
3305 | 3309 |
3306 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string_char_from_code") | 3310 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string_char_from_code") |
3307 }; | 3311 }; |
3308 | 3312 |
3309 | 3313 |
3310 class HStringLength: public HUnaryOperation { | 3314 class HStringLength: public HUnaryOperation { |
3311 public: | 3315 public: |
3312 explicit HStringLength(HValue* string) : HUnaryOperation(string) { | 3316 explicit HStringLength(HValue* string) : HUnaryOperation(string) { |
3313 set_representation(Representation::Tagged()); | 3317 set_representation(Representation::Tagged()); |
3314 SetFlag(kUseGVN); | 3318 SetFlag(kUseGVN); |
| 3319 SetFlag(kDependsOnMaps); |
3315 } | 3320 } |
3316 | 3321 |
3317 virtual Representation RequiredInputRepresentation(int index) const { | 3322 virtual Representation RequiredInputRepresentation(int index) const { |
3318 return Representation::Tagged(); | 3323 return Representation::Tagged(); |
3319 } | 3324 } |
3320 | 3325 |
3321 virtual HType CalculateInferredType() { | 3326 virtual HType CalculateInferredType() { |
3322 STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); | 3327 STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); |
3323 return HType::Smi(); | 3328 return HType::Smi(); |
3324 } | 3329 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3522 HValue* object() { return left(); } | 3527 HValue* object() { return left(); } |
3523 HValue* key() { return right(); } | 3528 HValue* key() { return right(); } |
3524 }; | 3529 }; |
3525 | 3530 |
3526 #undef DECLARE_INSTRUCTION | 3531 #undef DECLARE_INSTRUCTION |
3527 #undef DECLARE_CONCRETE_INSTRUCTION | 3532 #undef DECLARE_CONCRETE_INSTRUCTION |
3528 | 3533 |
3529 } } // namespace v8::internal | 3534 } } // namespace v8::internal |
3530 | 3535 |
3531 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3536 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |