Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Side by Side Diff: runtime/vm/intermediate_language_arm.cc

Issue 339593002: Fix bug in ARM instance field stores. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | tests/language/large_class_declaration_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 StoreInstanceFieldSlowPath* slow_path = 1949 StoreInstanceFieldSlowPath* slow_path =
1950 new StoreInstanceFieldSlowPath(this, *cls); 1950 new StoreInstanceFieldSlowPath(this, *cls);
1951 compiler->AddSlowPathCode(slow_path); 1951 compiler->AddSlowPathCode(slow_path);
1952 1952
1953 __ TryAllocate(*cls, 1953 __ TryAllocate(*cls,
1954 slow_path->entry_label(), 1954 slow_path->entry_label(),
1955 temp, 1955 temp,
1956 temp2); 1956 temp2);
1957 __ Bind(slow_path->exit_label()); 1957 __ Bind(slow_path->exit_label());
1958 __ MoveRegister(temp2, temp); 1958 __ MoveRegister(temp2, temp);
1959 __ StoreIntoObject(instance_reg, 1959 __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
1960 FieldAddress(instance_reg, offset_in_bytes_),
1961 temp2);
1962 } else { 1960 } else {
1963 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes_)); 1961 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes_));
1964 } 1962 }
1965 switch (cid) { 1963 switch (cid) {
1966 case kDoubleCid: 1964 case kDoubleCid:
1967 __ Comment("UnboxedDoubleStoreInstanceFieldInstr"); 1965 __ Comment("UnboxedDoubleStoreInstanceFieldInstr");
1968 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag); 1966 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag);
1969 break; 1967 break;
1970 case kFloat32x4Cid: 1968 case kFloat32x4Cid:
1971 __ Comment("UnboxedFloat32x4StoreInstanceFieldInstr"); 1969 __ Comment("UnboxedFloat32x4StoreInstanceFieldInstr");
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 __ CompareImmediate(temp, 2034 __ CompareImmediate(temp,
2037 reinterpret_cast<intptr_t>(Object::null())); 2035 reinterpret_cast<intptr_t>(Object::null()));
2038 __ b(&copy_double, NE); 2036 __ b(&copy_double, NE);
2039 2037
2040 __ TryAllocate(compiler->double_class(), 2038 __ TryAllocate(compiler->double_class(),
2041 slow_path->entry_label(), 2039 slow_path->entry_label(),
2042 temp, 2040 temp,
2043 temp2); 2041 temp2);
2044 __ Bind(slow_path->exit_label()); 2042 __ Bind(slow_path->exit_label());
2045 __ MoveRegister(temp2, temp); 2043 __ MoveRegister(temp2, temp);
2046 __ StoreIntoObject(instance_reg, 2044 __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
2047 FieldAddress(instance_reg, offset_in_bytes_),
2048 temp2);
2049 __ Bind(&copy_double); 2045 __ Bind(&copy_double);
2050 __ CopyDoubleField(temp, value_reg, TMP, temp2, fpu_temp); 2046 __ CopyDoubleField(temp, value_reg, TMP, temp2, fpu_temp);
2051 __ b(&skip_store); 2047 __ b(&skip_store);
2052 } 2048 }
2053 2049
2054 { 2050 {
2055 __ Bind(&store_float32x4); 2051 __ Bind(&store_float32x4);
2056 Label copy_float32x4; 2052 Label copy_float32x4;
2057 StoreInstanceFieldSlowPath* slow_path = 2053 StoreInstanceFieldSlowPath* slow_path =
2058 new StoreInstanceFieldSlowPath(this, compiler->float32x4_class()); 2054 new StoreInstanceFieldSlowPath(this, compiler->float32x4_class());
2059 compiler->AddSlowPathCode(slow_path); 2055 compiler->AddSlowPathCode(slow_path);
2060 2056
2061 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes_)); 2057 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes_));
2062 __ CompareImmediate(temp, 2058 __ CompareImmediate(temp,
2063 reinterpret_cast<intptr_t>(Object::null())); 2059 reinterpret_cast<intptr_t>(Object::null()));
2064 __ b(&copy_float32x4, NE); 2060 __ b(&copy_float32x4, NE);
2065 2061
2066 __ TryAllocate(compiler->float32x4_class(), 2062 __ TryAllocate(compiler->float32x4_class(),
2067 slow_path->entry_label(), 2063 slow_path->entry_label(),
2068 temp, 2064 temp,
2069 temp2); 2065 temp2);
2070 __ Bind(slow_path->exit_label()); 2066 __ Bind(slow_path->exit_label());
2071 __ MoveRegister(temp2, temp); 2067 __ MoveRegister(temp2, temp);
2072 __ StoreIntoObject(instance_reg, 2068 __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
2073 FieldAddress(instance_reg, offset_in_bytes_),
2074 temp2);
2075 __ Bind(&copy_float32x4); 2069 __ Bind(&copy_float32x4);
2076 __ CopyFloat32x4Field(temp, value_reg, TMP, temp2, fpu_temp); 2070 __ CopyFloat32x4Field(temp, value_reg, TMP, temp2, fpu_temp);
2077 __ b(&skip_store); 2071 __ b(&skip_store);
2078 } 2072 }
2079 2073
2080 { 2074 {
2081 __ Bind(&store_float64x2); 2075 __ Bind(&store_float64x2);
2082 Label copy_float64x2; 2076 Label copy_float64x2;
2083 StoreInstanceFieldSlowPath* slow_path = 2077 StoreInstanceFieldSlowPath* slow_path =
2084 new StoreInstanceFieldSlowPath(this, compiler->float64x2_class()); 2078 new StoreInstanceFieldSlowPath(this, compiler->float64x2_class());
2085 compiler->AddSlowPathCode(slow_path); 2079 compiler->AddSlowPathCode(slow_path);
2086 2080
2087 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes_)); 2081 __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes_));
2088 __ CompareImmediate(temp, 2082 __ CompareImmediate(temp,
2089 reinterpret_cast<intptr_t>(Object::null())); 2083 reinterpret_cast<intptr_t>(Object::null()));
2090 __ b(&copy_float64x2, NE); 2084 __ b(&copy_float64x2, NE);
2091 2085
2092 __ TryAllocate(compiler->float64x2_class(), 2086 __ TryAllocate(compiler->float64x2_class(),
2093 slow_path->entry_label(), 2087 slow_path->entry_label(),
2094 temp, 2088 temp,
2095 temp2); 2089 temp2);
2096 __ Bind(slow_path->exit_label()); 2090 __ Bind(slow_path->exit_label());
2097 __ MoveRegister(temp2, temp); 2091 __ MoveRegister(temp2, temp);
2098 __ StoreIntoObject(instance_reg, 2092 __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
2099 FieldAddress(instance_reg, offset_in_bytes_),
2100 temp2);
2101 __ Bind(&copy_float64x2); 2093 __ Bind(&copy_float64x2);
2102 __ CopyFloat64x2Field(temp, value_reg, TMP, temp2, fpu_temp); 2094 __ CopyFloat64x2Field(temp, value_reg, TMP, temp2, fpu_temp);
2103 __ b(&skip_store); 2095 __ b(&skip_store);
2104 } 2096 }
2105 2097
2106 __ Bind(&store_pointer); 2098 __ Bind(&store_pointer);
2107 } 2099 }
2108 2100
2109 if (ShouldEmitStoreBarrier()) { 2101 if (ShouldEmitStoreBarrier()) {
2110 const Register value_reg = locs()->in(1).reg(); 2102 const Register value_reg = locs()->in(1).reg();
2111 __ StoreIntoObject(instance_reg, 2103 __ StoreIntoObjectOffset(instance_reg,
2112 FieldAddress(instance_reg, offset_in_bytes_), 2104 offset_in_bytes_,
2113 value_reg, 2105 value_reg,
2114 CanValueBeSmi()); 2106 CanValueBeSmi());
2115 } else { 2107 } else {
2116 if (locs()->in(1).IsConstant()) { 2108 if (locs()->in(1).IsConstant()) {
2117 __ StoreIntoObjectNoBarrier( 2109 __ StoreIntoObjectNoBarrierOffset(
2118 instance_reg, 2110 instance_reg,
2119 FieldAddress(instance_reg, offset_in_bytes_), 2111 offset_in_bytes_,
2120 locs()->in(1).constant()); 2112 locs()->in(1).constant());
2121 } else { 2113 } else {
2122 const Register value_reg = locs()->in(1).reg(); 2114 const Register value_reg = locs()->in(1).reg();
2123 __ StoreIntoObjectNoBarrier(instance_reg, 2115 __ StoreIntoObjectNoBarrierOffset(instance_reg,
2124 FieldAddress(instance_reg, offset_in_bytes_), value_reg); 2116 offset_in_bytes_,
2117 value_reg);
2125 } 2118 }
2126 } 2119 }
2127 __ Bind(&skip_store); 2120 __ Bind(&skip_store);
2128 } 2121 }
2129 2122
2130 2123
2131 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Isolate* isolate, 2124 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Isolate* isolate,
2132 bool opt) const { 2125 bool opt) const {
2133 const intptr_t kNumInputs = 1; 2126 const intptr_t kNumInputs = 1;
2134 const intptr_t kNumTemps = 0; 2127 const intptr_t kNumTemps = 0;
(...skipping 4231 matching lines...) Expand 10 before | Expand all | Expand 10 after
6366 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 6359 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
6367 #if defined(DEBUG) 6360 #if defined(DEBUG)
6368 __ LoadImmediate(R4, kInvalidObjectPointer); 6361 __ LoadImmediate(R4, kInvalidObjectPointer);
6369 __ LoadImmediate(R5, kInvalidObjectPointer); 6362 __ LoadImmediate(R5, kInvalidObjectPointer);
6370 #endif 6363 #endif
6371 } 6364 }
6372 6365
6373 } // namespace dart 6366 } // namespace dart
6374 6367
6375 #endif // defined TARGET_ARCH_ARM 6368 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | tests/language/large_class_declaration_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698