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 #include "src/crankshaft/x64/lithium-x64.h" | 5 #include "src/crankshaft/x64/lithium-x64.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
10 | 10 |
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1954 return DefineAsRegister(new(zone()) LConstantT); | 1954 return DefineAsRegister(new(zone()) LConstantT); |
1955 } else { | 1955 } else { |
1956 UNREACHABLE(); | 1956 UNREACHABLE(); |
1957 return NULL; | 1957 return NULL; |
1958 } | 1958 } |
1959 } | 1959 } |
1960 | 1960 |
1961 | 1961 |
1962 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 1962 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
1963 LOperand* context = UseRegisterAtStart(instr->value()); | 1963 LOperand* context = UseRegisterAtStart(instr->value()); |
1964 LInstruction* result = | 1964 return DefineAsRegister(new (zone()) LLoadContextSlot(context)); |
1965 DefineAsRegister(new(zone()) LLoadContextSlot(context)); | |
1966 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { | |
1967 result = AssignEnvironment(result); | |
1968 } | |
1969 return result; | |
1970 } | 1965 } |
1971 | 1966 |
1972 | 1967 |
1973 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { | 1968 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
1974 LOperand* context; | 1969 LOperand* context; |
1975 LOperand* value; | 1970 LOperand* value; |
1976 LOperand* temp; | 1971 LOperand* temp; |
1977 context = UseRegister(instr->context()); | 1972 context = UseRegister(instr->context()); |
1978 if (instr->NeedsWriteBarrier()) { | 1973 if (instr->NeedsWriteBarrier()) { |
1979 value = UseTempRegister(instr->value()); | 1974 value = UseTempRegister(instr->value()); |
1980 temp = TempRegister(); | 1975 temp = TempRegister(); |
1981 } else { | 1976 } else { |
1982 value = UseRegister(instr->value()); | 1977 value = UseRegister(instr->value()); |
1983 temp = NULL; | 1978 temp = NULL; |
1984 } | 1979 } |
1985 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); | 1980 return new (zone()) LStoreContextSlot(context, value, temp); |
1986 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { | |
1987 result = AssignEnvironment(result); | |
1988 } | |
1989 return result; | |
1990 } | 1981 } |
1991 | 1982 |
1992 | 1983 |
1993 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 1984 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
1994 // Use the special mov rax, moffs64 encoding for external | 1985 // Use the special mov rax, moffs64 encoding for external |
1995 // memory accesses with 64-bit word-sized values. | 1986 // memory accesses with 64-bit word-sized values. |
1996 if (instr->access().IsExternalMemory() && | 1987 if (instr->access().IsExternalMemory() && |
1997 instr->access().offset() == 0 && | 1988 instr->access().offset() == 0 && |
1998 (instr->access().representation().IsSmi() || | 1989 (instr->access().representation().IsSmi() || |
1999 instr->access().representation().IsTagged() || | 1990 instr->access().representation().IsTagged() || |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2466 LOperand* index = UseTempRegister(instr->index()); | 2457 LOperand* index = UseTempRegister(instr->index()); |
2467 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2458 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2468 LInstruction* result = DefineSameAsFirst(load); | 2459 LInstruction* result = DefineSameAsFirst(load); |
2469 return AssignPointerMap(result); | 2460 return AssignPointerMap(result); |
2470 } | 2461 } |
2471 | 2462 |
2472 } // namespace internal | 2463 } // namespace internal |
2473 } // namespace v8 | 2464 } // namespace v8 |
2474 | 2465 |
2475 #endif // V8_TARGET_ARCH_X64 | 2466 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |