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

Side by Side Diff: vm/code_descriptors_test.cc

Issue 12052033: Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 11 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 | « vm/code_descriptors.cc ('k') | vm/code_generator_test.cc » ('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) 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/globals.h" 6 #include "vm/globals.h"
7 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) 7 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
8 8
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 const Array& stack_maps = 140 const Array& stack_maps =
141 Array::Handle(stackmap_table_builder->FinalizeStackmaps(code)); 141 Array::Handle(stackmap_table_builder->FinalizeStackmaps(code));
142 code.set_stackmaps(stack_maps); 142 code.set_stackmaps(stack_maps);
143 const Array& stack_map_list = Array::Handle(code.stackmaps()); 143 const Array& stack_map_list = Array::Handle(code.stackmaps());
144 EXPECT(!stack_map_list.IsNull()); 144 EXPECT(!stack_map_list.IsNull());
145 Stackmap& stack_map = Stackmap::Handle(); 145 Stackmap& stack_map = Stackmap::Handle();
146 EXPECT_EQ(4, stack_map_list.Length()); 146 EXPECT_EQ(4, stack_map_list.Length());
147 147
148 // Validate the first stack map entry. 148 // Validate the first stack map entry.
149 stack_map |= stack_map_list.At(0); 149 stack_map ^= stack_map_list.At(0);
150 EXPECT_EQ(kStackSlotCount, stack_map.Length()); 150 EXPECT_EQ(kStackSlotCount, stack_map.Length());
151 for (intptr_t i = 0; i < kStackSlotCount; ++i) { 151 for (intptr_t i = 0; i < kStackSlotCount; ++i) {
152 EXPECT_EQ(expectation0[i], stack_map.IsObject(i)); 152 EXPECT_EQ(expectation0[i], stack_map.IsObject(i));
153 } 153 }
154 154
155 // Validate the second stack map entry. 155 // Validate the second stack map entry.
156 stack_map |= stack_map_list.At(1); 156 stack_map ^= stack_map_list.At(1);
157 EXPECT_EQ(kStackSlotCount, stack_map.Length()); 157 EXPECT_EQ(kStackSlotCount, stack_map.Length());
158 for (intptr_t i = 0; i < kStackSlotCount; ++i) { 158 for (intptr_t i = 0; i < kStackSlotCount; ++i) {
159 EXPECT_EQ(expectation1[i], stack_map.IsObject(i)); 159 EXPECT_EQ(expectation1[i], stack_map.IsObject(i));
160 } 160 }
161 161
162 // Validate the third stack map entry. 162 // Validate the third stack map entry.
163 stack_map |= stack_map_list.At(2); 163 stack_map ^= stack_map_list.At(2);
164 EXPECT_EQ(kStackSlotCount, stack_map.Length()); 164 EXPECT_EQ(kStackSlotCount, stack_map.Length());
165 for (intptr_t i = 0; i < kStackSlotCount; ++i) { 165 for (intptr_t i = 0; i < kStackSlotCount; ++i) {
166 EXPECT_EQ(expectation2[i], stack_map.IsObject(i)); 166 EXPECT_EQ(expectation2[i], stack_map.IsObject(i));
167 } 167 }
168 168
169 // Validate the fourth stack map entry. 169 // Validate the fourth stack map entry.
170 stack_map |= stack_map_list.At(3); 170 stack_map ^= stack_map_list.At(3);
171 EXPECT_EQ(kStackSlotCount, stack_map.Length()); 171 EXPECT_EQ(kStackSlotCount, stack_map.Length());
172 for (intptr_t i = 0; i < kStackSlotCount; ++i) { 172 for (intptr_t i = 0; i < kStackSlotCount; ++i) {
173 EXPECT_EQ(expectation3[i], stack_map.IsObject(i)); 173 EXPECT_EQ(expectation3[i], stack_map.IsObject(i));
174 } 174 }
175 retval = true; 175 retval = true;
176 } else { 176 } else {
177 retval = false; 177 retval = false;
178 } 178 }
179 EXPECT(retval); 179 EXPECT(retval);
180 isolate->set_long_jump_base(base); 180 isolate->set_long_jump_base(base);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // is called, this should then cause the stack map of function 'A.foo' 278 // is called, this should then cause the stack map of function 'A.foo'
279 // to be traversed and the appropriate objects visited. 279 // to be traversed and the appropriate objects visited.
280 const Object& result = Object::Handle( 280 const Object& result = Object::Handle(
281 DartEntry::InvokeStatic(function_foo, Object::empty_array())); 281 DartEntry::InvokeStatic(function_foo, Object::empty_array()));
282 EXPECT(!result.IsError()); 282 EXPECT(!result.IsError());
283 } 283 }
284 284
285 } // namespace dart 285 } // namespace dart
286 286
287 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) 287 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64)
OLDNEW
« no previous file with comments | « vm/code_descriptors.cc ('k') | vm/code_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698