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 #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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 kPos, no_type_arguments, constructor, no_arguments, allocated))); | 481 kPos, no_type_arguments, constructor, no_arguments, allocated))); |
482 } | 482 } |
483 | 483 |
484 | 484 |
485 CODEGEN_TEST_RAW_RUN(AllocateNewObjectCodegen, function) { | 485 CODEGEN_TEST_RAW_RUN(AllocateNewObjectCodegen, function) { |
486 GrowableArray<const Object*> arguments; | 486 GrowableArray<const Object*> arguments; |
487 const Array& kNoArgumentNames = Array::Handle(); | 487 const Array& kNoArgumentNames = Array::Handle(); |
488 Object& result = Object::Handle(); | 488 Object& result = Object::Handle(); |
489 result = DartEntry::InvokeStatic(function, arguments, kNoArgumentNames); | 489 result = DartEntry::InvokeStatic(function, arguments, kNoArgumentNames); |
490 EXPECT(!result.IsError()); | 490 EXPECT(!result.IsError()); |
491 const Library& app_lib = Library::Handle( | 491 const GrowableObjectArray& libs = GrowableObjectArray::Handle( |
492 Isolate::Current()->object_store()->registered_libraries()); | 492 Isolate::Current()->object_store()->libraries()); |
| 493 ASSERT(!libs.IsNull()); |
| 494 // App lib is the last one that was loaded. |
| 495 intptr_t num_libs = libs.Length(); |
| 496 Library& app_lib = Library::Handle(); |
| 497 app_lib ^= libs.At(num_libs - 1); |
| 498 ASSERT(!app_lib.IsNull()); |
493 const Class& cls = Class::Handle( | 499 const Class& cls = Class::Handle( |
494 app_lib.LookupClass(String::Handle(String::NewSymbol("A")))); | 500 app_lib.LookupClass(String::Handle(String::NewSymbol("A")))); |
495 EXPECT_EQ(cls.raw(), result.clazz()); | 501 EXPECT_EQ(cls.raw(), result.clazz()); |
496 } | 502 } |
497 | 503 |
498 } // namespace dart | 504 } // namespace dart |
499 | 505 |
500 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) | 506 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) |
OLD | NEW |