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

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

Issue 12315087: Hook up simulator (if needed) when calling Dart code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/compiler.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 #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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 const TypeArguments& no_type_arguments = TypeArguments::ZoneHandle(); 538 const TypeArguments& no_type_arguments = TypeArguments::ZoneHandle();
539 ArgumentListNode* no_arguments = new ArgumentListNode(kPos); 539 ArgumentListNode* no_arguments = new ArgumentListNode(kPos);
540 const LocalVariable* allocated = test->CreateTempConstVariable("alloc"); 540 const LocalVariable* allocated = test->CreateTempConstVariable("alloc");
541 test->node_sequence()->Add(new ReturnNode(kPos, new ConstructorCallNode( 541 test->node_sequence()->Add(new ReturnNode(kPos, new ConstructorCallNode(
542 kPos, no_type_arguments, constructor, no_arguments, allocated))); 542 kPos, no_type_arguments, constructor, no_arguments, allocated)));
543 } 543 }
544 544
545 545
546 CODEGEN_TEST_RAW_RUN(AllocateNewObjectCodegen, function) { 546 CODEGEN_TEST_RAW_RUN(AllocateNewObjectCodegen, function) {
547 const Object& result = Object::Handle( 547 const Object& result = Object::Handle(
548 DartEntry::InvokeStatic(function, Object::empty_array())); 548 DartEntry::InvokeFunction(function, Object::empty_array()));
549 EXPECT(!result.IsError()); 549 EXPECT(!result.IsError());
550 const GrowableObjectArray& libs = GrowableObjectArray::Handle( 550 const GrowableObjectArray& libs = GrowableObjectArray::Handle(
551 Isolate::Current()->object_store()->libraries()); 551 Isolate::Current()->object_store()->libraries());
552 ASSERT(!libs.IsNull()); 552 ASSERT(!libs.IsNull());
553 // App lib is the last one that was loaded. 553 // App lib is the last one that was loaded.
554 intptr_t num_libs = libs.Length(); 554 intptr_t num_libs = libs.Length();
555 Library& app_lib = Library::Handle(); 555 Library& app_lib = Library::Handle();
556 app_lib ^= libs.At(num_libs - 1); 556 app_lib ^= libs.At(num_libs - 1);
557 ASSERT(!app_lib.IsNull()); 557 ASSERT(!app_lib.IsNull());
558 const Class& cls = Class::Handle( 558 const Class& cls = Class::Handle(
559 app_lib.LookupClass(String::Handle(Symbols::New("A")))); 559 app_lib.LookupClass(String::Handle(Symbols::New("A"))));
560 EXPECT_EQ(cls.raw(), result.clazz()); 560 EXPECT_EQ(cls.raw(), result.clazz());
561 } 561 }
562 562
563 } // namespace dart 563 } // namespace dart
564 564
565 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) 565 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64)
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698