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

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

Issue 99373002: Mark native functions when they are created. (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/class_finalizer.cc ('k') | runtime/vm/code_patcher_arm_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 10 matching lines...) Expand all
21 21
22 22
23 CODEGEN_TEST_GENERATE(StackmapCodegen, test) { 23 CODEGEN_TEST_GENERATE(StackmapCodegen, test) {
24 Assembler assembler; 24 Assembler assembler;
25 const String& function_name = String::ZoneHandle(Symbols::New("test")); 25 const String& function_name = String::ZoneHandle(Symbols::New("test"));
26 Class& cls = Class::ZoneHandle(); 26 Class& cls = Class::ZoneHandle();
27 const Script& script = Script::Handle(); 27 const Script& script = Script::Handle();
28 cls = Class::New(function_name, script, Scanner::kDummyTokenIndex); 28 cls = Class::New(function_name, script, Scanner::kDummyTokenIndex);
29 const Function& function = Function::ZoneHandle( 29 const Function& function = Function::ZoneHandle(
30 Function::New(function_name, RawFunction::kRegularFunction, 30 Function::New(function_name, RawFunction::kRegularFunction,
31 true, false, false, false, cls, 0)); 31 true, false, false, false, false, cls, 0));
32 function.set_result_type(Type::Handle(Type::DynamicType())); 32 function.set_result_type(Type::Handle(Type::DynamicType()));
33 const Array& functions = Array::Handle(Array::New(1)); 33 const Array& functions = Array::Handle(Array::New(1));
34 functions.SetAt(0, function); 34 functions.SetAt(0, function);
35 cls.SetFunctions(functions); 35 cls.SetFunctions(functions);
36 Library& lib = Library::Handle(Library::CoreLibrary()); 36 Library& lib = Library::Handle(Library::CoreLibrary());
37 lib.AddClass(cls); 37 lib.AddClass(cls);
38 ParsedFunction* parsed_function = new ParsedFunction(function); 38 ParsedFunction* parsed_function = new ParsedFunction(function);
39 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1))); 39 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1)));
40 test->node_sequence()->Add(new ReturnNode(kPos, l)); 40 test->node_sequence()->Add(new ReturnNode(kPos, l));
41 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2))); 41 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2)));
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 // Now invoke 'A.moo' and it will trigger a GC when the native function 274 // 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' 275 // is called, this should then cause the stack map of function 'A.foo'
276 // to be traversed and the appropriate objects visited. 276 // to be traversed and the appropriate objects visited.
277 const Object& result = Object::Handle( 277 const Object& result = Object::Handle(
278 DartEntry::InvokeFunction(function_foo, Object::empty_array())); 278 DartEntry::InvokeFunction(function_foo, Object::empty_array()));
279 EXPECT(!result.IsError()); 279 EXPECT(!result.IsError());
280 } 280 }
281 281
282 } // namespace dart 282 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/code_patcher_arm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698