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

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

Issue 117723002: Allow the native resolver to setup whether it needs the Dart API scope to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/bootstrap_natives.cc ('k') | runtime/vm/custom_isolate_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 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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.cc ('k') | runtime/vm/custom_isolate_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698