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 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 return hydrogen()->is_external(); | 1401 return hydrogen()->is_external(); |
1402 } | 1402 } |
1403 | 1403 |
1404 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1404 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
1405 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1405 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
1406 | 1406 |
1407 uint32_t additional_index() const { return hydrogen()->index_offset(); } | 1407 uint32_t additional_index() const { return hydrogen()->index_offset(); } |
1408 }; | 1408 }; |
1409 | 1409 |
1410 | 1410 |
1411 inline static bool ExternalArrayOpRequiresTemp( | 1411 template <class T> |
1412 Representation key_representation, | 1412 inline static bool ExternalArrayOpRequiresTemp(T* value) { |
1413 ElementsKind elements_kind) { | 1413 CHECK(value->IsLoadKeyed() || value->IsStoreKeyed()); |
| 1414 Representation key_representation = value->key()->representation(); |
| 1415 ElementsKind elements_kind = value->elements_kind(); |
| 1416 |
1414 // Operations that require the key to be divided by two to be converted into | 1417 // Operations that require the key to be divided by two to be converted into |
1415 // an index cannot fold the scale operation into a load and need an extra | 1418 // an index cannot fold the scale operation into a load and need an extra |
1416 // temp register to do the work. | 1419 // temp register to do the work. |
1417 return key_representation.IsTagged() && | 1420 return !value->IsConstant() && key_representation.IsTagged() && |
1418 (elements_kind == EXTERNAL_BYTE_ELEMENTS || | 1421 (elements_kind == EXTERNAL_BYTE_ELEMENTS || |
1419 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || | 1422 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || |
1420 elements_kind == EXTERNAL_PIXEL_ELEMENTS); | 1423 elements_kind == EXTERNAL_PIXEL_ELEMENTS); |
1421 } | 1424 } |
1422 | 1425 |
1423 | 1426 |
1424 class LLoadKeyedGeneric: public LTemplateInstruction<1, 3, 0> { | 1427 class LLoadKeyedGeneric: public LTemplateInstruction<1, 3, 0> { |
1425 public: | 1428 public: |
1426 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { | 1429 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) { |
1427 inputs_[0] = context; | 1430 inputs_[0] = context; |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2655 | 2658 |
2656 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2659 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2657 }; | 2660 }; |
2658 | 2661 |
2659 #undef DECLARE_HYDROGEN_ACCESSOR | 2662 #undef DECLARE_HYDROGEN_ACCESSOR |
2660 #undef DECLARE_CONCRETE_INSTRUCTION | 2663 #undef DECLARE_CONCRETE_INSTRUCTION |
2661 | 2664 |
2662 } } // namespace v8::internal | 2665 } } // namespace v8::internal |
2663 | 2666 |
2664 #endif // V8_IA32_LITHIUM_IA32_H_ | 2667 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |