| 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 "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/globals.h" | 6 #include "vm/globals.h" |
| 7 | 7 |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 int64_t value = -1; | 187 int64_t value = -1; |
| 188 EXPECT_VALID(Dart_IntegerToInt64(i, &value)); | 188 EXPECT_VALID(Dart_IntegerToInt64(i, &value)); |
| 189 EXPECT_EQ(10, value); | 189 EXPECT_EQ(10, value); |
| 190 EXPECT_VALID(Dart_IntegerToInt64(k, &value)); | 190 EXPECT_VALID(Dart_IntegerToInt64(k, &value)); |
| 191 EXPECT_EQ(20, value); | 191 EXPECT_EQ(20, value); |
| 192 Isolate::Current()->heap()->CollectAllGarbage(); | 192 Isolate::Current()->heap()->CollectAllGarbage(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 | 195 |
| 196 static Dart_NativeFunction native_resolver(Dart_Handle name, | 196 static Dart_NativeFunction native_resolver(Dart_Handle name, |
| 197 int argument_count) { | 197 int argument_count, |
| 198 bool* auto_setup_scope) { |
| 199 ASSERT(auto_setup_scope); |
| 200 *auto_setup_scope = false; |
| 198 return reinterpret_cast<Dart_NativeFunction>(&NativeFunc); | 201 return reinterpret_cast<Dart_NativeFunction>(&NativeFunc); |
| 199 } | 202 } |
| 200 | 203 |
| 201 | 204 |
| 202 TEST_CASE(StackmapGC) { | 205 TEST_CASE(StackmapGC) { |
| 203 const char* kScriptChars = | 206 const char* kScriptChars = |
| 204 "class A {" | 207 "class A {" |
| 205 " static void func(var i, var k) native 'NativeFunc';" | 208 " static void func(var i, var k) native 'NativeFunc';" |
| 206 " static foo() {" | 209 " static foo() {" |
| 207 " var i;" | 210 " var i;" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 276 |
| 274 // 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 |
| 275 // 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' |
| 276 // to be traversed and the appropriate objects visited. | 279 // to be traversed and the appropriate objects visited. |
| 277 const Object& result = Object::Handle( | 280 const Object& result = Object::Handle( |
| 278 DartEntry::InvokeFunction(function_foo, Object::empty_array())); | 281 DartEntry::InvokeFunction(function_foo, Object::empty_array())); |
| 279 EXPECT(!result.IsError()); | 282 EXPECT(!result.IsError()); |
| 280 } | 283 } |
| 281 | 284 |
| 282 } // namespace dart | 285 } // namespace dart |
| OLD | NEW |