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

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

Issue 11028145: Changed StackZone and ApiZone to be containers for Zone. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added assertion for ApiZone linking. Created 8 years, 2 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
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 static void NativeFunc(Dart_NativeArguments args) { 185 static void NativeFunc(Dart_NativeArguments args) {
186 Dart_EnterScope(); 186 Dart_EnterScope();
187 Dart_Handle i = Dart_GetNativeArgument(args, 0); 187 Dart_Handle i = Dart_GetNativeArgument(args, 0);
188 Dart_Handle k = Dart_GetNativeArgument(args, 1); 188 Dart_Handle k = Dart_GetNativeArgument(args, 1);
189 int64_t value = -1; 189 int64_t value = -1;
190 EXPECT_VALID(Dart_IntegerToInt64(i, &value)); 190 EXPECT_VALID(Dart_IntegerToInt64(i, &value));
191 EXPECT_EQ(10, value); 191 EXPECT_EQ(10, value);
192 EXPECT_VALID(Dart_IntegerToInt64(k, &value)); 192 EXPECT_VALID(Dart_IntegerToInt64(k, &value));
193 EXPECT_EQ(20, value); 193 EXPECT_EQ(20, value);
194 Isolate::Current()->heap()->CollectAllGarbage(); 194 Isolate::Current()->heap()->CollectAllGarbage();
195 Dart_ExitScope();
195 } 196 }
196 197
197 198
198 static Dart_NativeFunction native_resolver(Dart_Handle name, 199 static Dart_NativeFunction native_resolver(Dart_Handle name,
199 int argument_count) { 200 int argument_count) {
200 return reinterpret_cast<Dart_NativeFunction>(&NativeFunc); 201 return reinterpret_cast<Dart_NativeFunction>(&NativeFunc);
201 } 202 }
202 203
203 204
204 TEST_CASE(StackmapGC) { 205 TEST_CASE(StackmapGC) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 code.set_stackmaps(stack_maps); 275 code.set_stackmaps(stack_maps);
275 276
276 // Now invoke 'A.moo' and it will trigger a GC when the native function 277 // Now invoke 'A.moo' and it will trigger a GC when the native function
277 // 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'
278 // to be traversed and the appropriate objects visited. 279 // to be traversed and the appropriate objects visited.
279 GrowableArray<const Object*> arguments; 280 GrowableArray<const Object*> arguments;
280 const Array& kNoArgumentNames = Array::Handle(); 281 const Array& kNoArgumentNames = Array::Handle();
281 Object& result = Object::Handle(); 282 Object& result = Object::Handle();
282 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); 283 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames);
283 EXPECT(!result.IsError()); 284 EXPECT(!result.IsError());
285 (void) kNoArgumentNames;
siva 2012/10/12 20:40:21 we have a macro USE for silencing compiler warning
Tom Ball 2012/10/12 22:56:51 It wasn't a problem, just debugging cruft that's n
286 (void) result;
284 } 287 }
285 288
286 } // namespace dart 289 } // namespace dart
287 290
288 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) 291 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698