| 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 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2031 (instr->representation().IsInteger32() && | 2031 (instr->representation().IsInteger32() && |
| 2032 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) || | 2032 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) || |
| 2033 (instr->representation().IsDouble() && | 2033 (instr->representation().IsDouble() && |
| 2034 (IsDoubleOrFloatElementsKind(instr->elements_kind())))); | 2034 (IsDoubleOrFloatElementsKind(instr->elements_kind())))); |
| 2035 LOperand* backing_store = UseRegister(instr->elements()); | 2035 LOperand* backing_store = UseRegister(instr->elements()); |
| 2036 result = new(zone()) LLoadKeyed(backing_store, key); | 2036 result = new(zone()) LLoadKeyed(backing_store, key); |
| 2037 } | 2037 } |
| 2038 | 2038 |
| 2039 DefineAsRegister(result); | 2039 DefineAsRegister(result); |
| 2040 bool can_deoptimize = instr->RequiresHoleCheck() || | 2040 bool can_deoptimize = instr->RequiresHoleCheck() || |
| 2041 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) || | 2041 (elements_kind == EXTERNAL_UINT32_ELEMENTS) || |
| 2042 (elements_kind == UINT32_ELEMENTS); | 2042 (elements_kind == UINT32_ELEMENTS); |
| 2043 // An unsigned int array load might overflow and cause a deopt, make sure it | 2043 // An unsigned int array load might overflow and cause a deopt, make sure it |
| 2044 // has an environment. | 2044 // has an environment. |
| 2045 return can_deoptimize ? AssignEnvironment(result) : result; | 2045 return can_deoptimize ? AssignEnvironment(result) : result; |
| 2046 } | 2046 } |
| 2047 | 2047 |
| 2048 | 2048 |
| 2049 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 2049 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
| 2050 LOperand* context = UseFixed(instr->context(), rsi); | 2050 LOperand* context = UseFixed(instr->context(), rsi); |
| 2051 LOperand* object = UseFixed(instr->object(), rdx); | 2051 LOperand* object = UseFixed(instr->object(), rdx); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2092 ASSERT( | 2092 ASSERT( |
| 2093 (instr->value()->representation().IsInteger32() && | 2093 (instr->value()->representation().IsInteger32() && |
| 2094 !IsDoubleOrFloatElementsKind(elements_kind)) || | 2094 !IsDoubleOrFloatElementsKind(elements_kind)) || |
| 2095 (instr->value()->representation().IsDouble() && | 2095 (instr->value()->representation().IsDouble() && |
| 2096 IsDoubleOrFloatElementsKind(elements_kind))); | 2096 IsDoubleOrFloatElementsKind(elements_kind))); |
| 2097 ASSERT((instr->is_fixed_typed_array() && | 2097 ASSERT((instr->is_fixed_typed_array() && |
| 2098 instr->elements()->representation().IsTagged()) || | 2098 instr->elements()->representation().IsTagged()) || |
| 2099 (instr->is_external() && | 2099 (instr->is_external() && |
| 2100 instr->elements()->representation().IsExternal())); | 2100 instr->elements()->representation().IsExternal())); |
| 2101 bool val_is_temp_register = | 2101 bool val_is_temp_register = |
| 2102 elements_kind == EXTERNAL_PIXEL_ELEMENTS || | 2102 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS || |
| 2103 elements_kind == EXTERNAL_FLOAT_ELEMENTS || | 2103 elements_kind == EXTERNAL_FLOAT32_ELEMENTS || |
| 2104 elements_kind == FLOAT32_ELEMENTS; | 2104 elements_kind == FLOAT32_ELEMENTS; |
| 2105 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) | 2105 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) |
| 2106 : UseRegister(instr->value()); | 2106 : UseRegister(instr->value()); |
| 2107 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2107 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 2108 LOperand* backing_store = UseRegister(instr->elements()); | 2108 LOperand* backing_store = UseRegister(instr->elements()); |
| 2109 return new(zone()) LStoreKeyed(backing_store, key, val); | 2109 return new(zone()) LStoreKeyed(backing_store, key, val); |
| 2110 } | 2110 } |
| 2111 | 2111 |
| 2112 | 2112 |
| 2113 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 2113 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2489 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2489 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2490 LOperand* object = UseRegister(instr->object()); | 2490 LOperand* object = UseRegister(instr->object()); |
| 2491 LOperand* index = UseTempRegister(instr->index()); | 2491 LOperand* index = UseTempRegister(instr->index()); |
| 2492 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2492 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2493 } | 2493 } |
| 2494 | 2494 |
| 2495 | 2495 |
| 2496 } } // namespace v8::internal | 2496 } } // namespace v8::internal |
| 2497 | 2497 |
| 2498 #endif // V8_TARGET_ARCH_X64 | 2498 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |