| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 case Token::kBIT_NOT: | 1950 case Token::kBIT_NOT: |
| 1951 __ notq(value); | 1951 __ notq(value); |
| 1952 __ andq(value, Immediate(~kSmiTagMask)); // Remove inverted smi-tag. | 1952 __ andq(value, Immediate(~kSmiTagMask)); // Remove inverted smi-tag. |
| 1953 break; | 1953 break; |
| 1954 default: | 1954 default: |
| 1955 UNREACHABLE(); | 1955 UNREACHABLE(); |
| 1956 } | 1956 } |
| 1957 } | 1957 } |
| 1958 | 1958 |
| 1959 | 1959 |
| 1960 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const { | |
| 1961 const intptr_t kNumInputs = 1; | |
| 1962 const intptr_t kNumTemps = 0; | |
| 1963 LocationSummary* locs = | |
| 1964 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | |
| 1965 locs->set_in(0, Location::RequiresRegister()); | |
| 1966 locs->set_out(Location::SameAsFirstInput()); | |
| 1967 return locs; | |
| 1968 } | |
| 1969 | |
| 1970 | |
| 1971 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 1972 Register value = locs()->in(0).reg(); | |
| 1973 Register result = locs()->out().reg(); | |
| 1974 | |
| 1975 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), | |
| 1976 kDeoptDoubleToDouble); | |
| 1977 | |
| 1978 __ testq(value, Immediate(kSmiTagMask)); | |
| 1979 __ j(ZERO, deopt); // Deoptimize if Smi. | |
| 1980 __ CompareClassId(value, kDoubleCid); | |
| 1981 __ j(NOT_EQUAL, deopt); // Deoptimize if not Double. | |
| 1982 ASSERT(value == result); | |
| 1983 } | |
| 1984 | |
| 1985 | |
| 1986 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const { | 1960 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const { |
| 1987 return MakeCallSummary(); // Calls a stub to allocate result. | 1961 return MakeCallSummary(); // Calls a stub to allocate result. |
| 1988 } | 1962 } |
| 1989 | 1963 |
| 1990 | 1964 |
| 1991 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1965 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1992 Register result = locs()->out().reg(); | 1966 Register result = locs()->out().reg(); |
| 1993 | 1967 |
| 1994 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), | 1968 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), |
| 1995 kDeoptIntegerToDouble); | 1969 kDeoptIntegerToDouble); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2307 | 2281 |
| 2308 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2282 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2309 UNIMPLEMENTED(); | 2283 UNIMPLEMENTED(); |
| 2310 } | 2284 } |
| 2311 | 2285 |
| 2312 } // namespace dart | 2286 } // namespace dart |
| 2313 | 2287 |
| 2314 #undef __ | 2288 #undef __ |
| 2315 | 2289 |
| 2316 #endif // defined TARGET_ARCH_X64 | 2290 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |