OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 | 1964 |
1965 | 1965 |
1966 // When the parser is building an implicit static getter for optimization, | 1966 // When the parser is building an implicit static getter for optimization, |
1967 // it can generate a function body where deoptimization ids do not line up | 1967 // it can generate a function body where deoptimization ids do not line up |
1968 // with the unoptimized code. | 1968 // with the unoptimized code. |
1969 // | 1969 // |
1970 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. | 1970 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. |
1971 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1971 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1972 Register field = locs()->in(0).reg(); | 1972 Register field = locs()->in(0).reg(); |
1973 Register result = locs()->out(0).reg(); | 1973 Register result = locs()->out(0).reg(); |
1974 __ movl(result, FieldAddress(field, Field::value_offset())); | 1974 __ movl(result, FieldAddress(field, Field::static_value_offset())); |
1975 } | 1975 } |
1976 | 1976 |
1977 | 1977 |
1978 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone, | 1978 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone, |
1979 bool opt) const { | 1979 bool opt) const { |
1980 LocationSummary* locs = new(zone) LocationSummary( | 1980 LocationSummary* locs = new(zone) LocationSummary( |
1981 zone, 1, 1, LocationSummary::kNoCall); | 1981 zone, 1, 1, LocationSummary::kNoCall); |
1982 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() | 1982 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() |
1983 : Location::RequiresRegister()); | 1983 : Location::RequiresRegister()); |
1984 locs->set_temp(0, Location::RequiresRegister()); | 1984 locs->set_temp(0, Location::RequiresRegister()); |
1985 return locs; | 1985 return locs; |
1986 } | 1986 } |
1987 | 1987 |
1988 | 1988 |
1989 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1989 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1990 Register value = locs()->in(0).reg(); | 1990 Register value = locs()->in(0).reg(); |
1991 Register temp = locs()->temp(0).reg(); | 1991 Register temp = locs()->temp(0).reg(); |
1992 | 1992 |
1993 __ LoadObject(temp, field()); | 1993 __ LoadObject(temp, field()); |
1994 if (this->value()->NeedsStoreBuffer()) { | 1994 if (this->value()->NeedsStoreBuffer()) { |
1995 __ StoreIntoObject(temp, | 1995 __ StoreIntoObject(temp, |
1996 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); | 1996 FieldAddress(temp, Field::static_value_offset()), |
| 1997 value, |
| 1998 CanValueBeSmi()); |
1997 } else { | 1999 } else { |
1998 __ StoreIntoObjectNoBarrier( | 2000 __ StoreIntoObjectNoBarrier( |
1999 temp, FieldAddress(temp, Field::value_offset()), value); | 2001 temp, FieldAddress(temp, Field::static_value_offset()), value); |
2000 } | 2002 } |
2001 } | 2003 } |
2002 | 2004 |
2003 | 2005 |
2004 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone, | 2006 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone, |
2005 bool opt) const { | 2007 bool opt) const { |
2006 const intptr_t kNumInputs = 3; | 2008 const intptr_t kNumInputs = 3; |
2007 const intptr_t kNumTemps = 0; | 2009 const intptr_t kNumTemps = 0; |
2008 LocationSummary* summary = new(zone) LocationSummary( | 2010 LocationSummary* summary = new(zone) LocationSummary( |
2009 zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 2011 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2486 return locs; | 2488 return locs; |
2487 } | 2489 } |
2488 | 2490 |
2489 | 2491 |
2490 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2492 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2491 Register field = locs()->in(0).reg(); | 2493 Register field = locs()->in(0).reg(); |
2492 Register temp = locs()->temp(0).reg(); | 2494 Register temp = locs()->temp(0).reg(); |
2493 | 2495 |
2494 Label call_runtime, no_call; | 2496 Label call_runtime, no_call; |
2495 | 2497 |
2496 __ movl(temp, FieldAddress(field, Field::value_offset())); | 2498 __ movl(temp, FieldAddress(field, Field::static_value_offset())); |
2497 __ CompareObject(temp, Object::sentinel()); | 2499 __ CompareObject(temp, Object::sentinel()); |
2498 __ j(EQUAL, &call_runtime); | 2500 __ j(EQUAL, &call_runtime); |
2499 | 2501 |
2500 __ CompareObject(temp, Object::transition_sentinel()); | 2502 __ CompareObject(temp, Object::transition_sentinel()); |
2501 __ j(NOT_EQUAL, &no_call); | 2503 __ j(NOT_EQUAL, &no_call); |
2502 | 2504 |
2503 __ Bind(&call_runtime); | 2505 __ Bind(&call_runtime); |
2504 __ PushObject(Object::null_object()); // Make room for (unused) result. | 2506 __ PushObject(Object::null_object()); // Make room for (unused) result. |
2505 __ pushl(field); | 2507 __ pushl(field); |
2506 compiler->GenerateRuntimeCall(token_pos(), | 2508 compiler->GenerateRuntimeCall(token_pos(), |
(...skipping 4359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6866 __ Drop(1); | 6868 __ Drop(1); |
6867 __ popl(result); | 6869 __ popl(result); |
6868 } | 6870 } |
6869 | 6871 |
6870 | 6872 |
6871 } // namespace dart | 6873 } // namespace dart |
6872 | 6874 |
6873 #undef __ | 6875 #undef __ |
6874 | 6876 |
6875 #endif // defined TARGET_ARCH_IA32 | 6877 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |