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

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

Issue 460763002: Fix returning from async functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 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 20 matching lines...) Expand all
31 true, false, 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 = 38 ParsedFunction* parsed_function =
39 new ParsedFunction(Isolate::Current(), function); 39 new ParsedFunction(Isolate::Current(), function);
40 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1))); 40 LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1)));
41 test->node_sequence()->Add(new ReturnNode(kPos, l)); 41 test->node_sequence()->Add(new ReturnNode(kPos, l, NULL));
42 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2))); 42 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2)));
43 test->node_sequence()->Add(new ReturnNode(kPos, l)); 43 test->node_sequence()->Add(new ReturnNode(kPos, l, NULL));
44 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))); 44 l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3)));
45 test->node_sequence()->Add(new ReturnNode(kPos, l)); 45 test->node_sequence()->Add(new ReturnNode(kPos, l, NULL));
46 parsed_function->SetNodeSequence(test->node_sequence()); 46 parsed_function->SetNodeSequence(test->node_sequence());
47 parsed_function->set_instantiator(NULL); 47 parsed_function->set_instantiator(NULL);
48 parsed_function->set_default_parameter_values(Object::null_array()); 48 parsed_function->set_default_parameter_values(Object::null_array());
49 parsed_function->AllocateVariables(); 49 parsed_function->AllocateVariables();
50 bool retval; 50 bool retval;
51 Isolate* isolate = Isolate::Current(); 51 Isolate* isolate = Isolate::Current();
52 EXPECT(isolate != NULL); 52 EXPECT(isolate != NULL);
53 LongJumpScope jump; 53 LongJumpScope jump;
54 if (setjmp(*jump.Set()) == 0) { 54 if (setjmp(*jump.Set()) == 0) {
55 // Build a stackmap table and some stackmap table entries. 55 // Build a stackmap table and some stackmap table entries.
(...skipping 217 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

Powered by Google App Engine
This is Rietveld 408576698