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

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

Issue 239303008: Adds object pool, LoadImmediate, and LoadObject to ARM64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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/object_arm64_test.cc ('k') | runtime/vm/simulator_arm64.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 // TODO(zra): Remove when tests are ready to enable. 5 // TODO(zra): Remove when tests are ready to enable.
6 #include "platform/globals.h" 6 #include "platform/globals.h"
7 #if !defined(TARGET_ARCH_ARM64)
8 7
9 #include "vm/assembler.h" 8 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
11 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
12 #include "vm/dart_api_impl.h" 11 #include "vm/dart_api_impl.h"
13 #include "vm/dart_entry.h" 12 #include "vm/dart_entry.h"
14 #include "vm/debugger.h" 13 #include "vm/debugger.h"
15 #include "vm/isolate.h" 14 #include "vm/isolate.h"
16 #include "vm/object.h" 15 #include "vm/object.h"
17 #include "vm/object_store.h" 16 #include "vm/object_store.h"
(...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after
2491 extern void GenerateIncrement(Assembler* assembler); 2490 extern void GenerateIncrement(Assembler* assembler);
2492 Assembler _assembler_; 2491 Assembler _assembler_;
2493 GenerateIncrement(&_assembler_); 2492 GenerateIncrement(&_assembler_);
2494 Code& code = Code::Handle(Code::FinalizeCode( 2493 Code& code = Code::Handle(Code::FinalizeCode(
2495 *CreateFunction("Test_Code"), &_assembler_)); 2494 *CreateFunction("Test_Code"), &_assembler_));
2496 Instructions& instructions = Instructions::Handle(code.instructions()); 2495 Instructions& instructions = Instructions::Handle(code.instructions());
2497 uword entry_point = instructions.EntryPoint(); 2496 uword entry_point = instructions.EntryPoint();
2498 intptr_t retval = 0; 2497 intptr_t retval = 0;
2499 #if defined(USING_SIMULATOR) 2498 #if defined(USING_SIMULATOR)
2500 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call( 2499 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
2501 static_cast<int32_t>(entry_point), 0, 0, 0, 0)); 2500 static_cast<intptr_t>(entry_point), 0, 0, 0, 0));
2502 #else 2501 #else
2503 typedef intptr_t (*IncrementCode)(); 2502 typedef intptr_t (*IncrementCode)();
2504 retval = reinterpret_cast<IncrementCode>(entry_point)(); 2503 retval = reinterpret_cast<IncrementCode>(entry_point)();
2505 #endif 2504 #endif
2506 EXPECT_EQ(2, retval); 2505 EXPECT_EQ(2, retval);
2507 EXPECT_EQ(instructions.raw(), Instructions::FromEntryPoint(entry_point)); 2506 EXPECT_EQ(instructions.raw(), Instructions::FromEntryPoint(entry_point));
2508 } 2507 }
2509 2508
2510 2509
2511 // Test for immutability of generated instructions. The test crashes with a 2510 // Test for immutability of generated instructions. The test crashes with a
2512 // segmentation fault when writing into it. 2511 // segmentation fault when writing into it.
2513 TEST_CASE(CodeImmutability) { 2512 TEST_CASE(CodeImmutability) {
2514 extern void GenerateIncrement(Assembler* assembler); 2513 extern void GenerateIncrement(Assembler* assembler);
2515 Assembler _assembler_; 2514 Assembler _assembler_;
2516 GenerateIncrement(&_assembler_); 2515 GenerateIncrement(&_assembler_);
2517 Code& code = Code::Handle(Code::FinalizeCode( 2516 Code& code = Code::Handle(Code::FinalizeCode(
2518 *CreateFunction("Test_Code"), &_assembler_)); 2517 *CreateFunction("Test_Code"), &_assembler_));
2519 Instructions& instructions = Instructions::Handle(code.instructions()); 2518 Instructions& instructions = Instructions::Handle(code.instructions());
2520 uword entry_point = instructions.EntryPoint(); 2519 uword entry_point = instructions.EntryPoint();
2521 // Try writing into the generated code, expected to crash. 2520 // Try writing into the generated code, expected to crash.
2522 *(reinterpret_cast<char*>(entry_point) + 1) = 1; 2521 *(reinterpret_cast<char*>(entry_point) + 1) = 1;
2523 intptr_t retval = 0; 2522 intptr_t retval = 0;
2524 #if defined(USING_SIMULATOR) 2523 #if defined(USING_SIMULATOR)
2525 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call( 2524 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
2526 static_cast<int32_t>(entry_point), 0, 0, 0, 0)); 2525 static_cast<intptr_t>(entry_point), 0, 0, 0, 0));
2527 #else 2526 #else
2528 typedef intptr_t (*IncrementCode)(); 2527 typedef intptr_t (*IncrementCode)();
2529 retval = reinterpret_cast<IncrementCode>(entry_point)(); 2528 retval = reinterpret_cast<IncrementCode>(entry_point)();
2530 #endif 2529 #endif
2531 EXPECT_EQ(3, retval); 2530 EXPECT_EQ(3, retval);
2532 EXPECT_EQ(instructions.raw(), Instructions::FromEntryPoint(entry_point)); 2531 EXPECT_EQ(instructions.raw(), Instructions::FromEntryPoint(entry_point));
2533 if (!FLAG_write_protect_code) { 2532 if (!FLAG_write_protect_code) {
2534 // Since this test is expected to crash, crash if write protection of code 2533 // Since this test is expected to crash, crash if write protection of code
2535 // is switched off. 2534 // is switched off.
2536 OS::DebugBreak(); 2535 OS::DebugBreak();
2537 } 2536 }
2538 } 2537 }
2539 2538
2540 2539
2541 // Test for Embedded String object in the instructions. 2540 // Test for Embedded String object in the instructions.
2542 TEST_CASE(EmbedStringInCode) { 2541 TEST_CASE(EmbedStringInCode) {
2543 extern void GenerateEmbedStringInCode(Assembler* assembler, const char* str); 2542 extern void GenerateEmbedStringInCode(Assembler* assembler, const char* str);
2544 const char* kHello = "Hello World!"; 2543 const char* kHello = "Hello World!";
2545 word expected_length = static_cast<word>(strlen(kHello)); 2544 word expected_length = static_cast<word>(strlen(kHello));
2546 Assembler _assembler_; 2545 Assembler _assembler_;
2547 GenerateEmbedStringInCode(&_assembler_, kHello); 2546 GenerateEmbedStringInCode(&_assembler_, kHello);
2548 Code& code = Code::Handle(Code::FinalizeCode( 2547 Code& code = Code::Handle(Code::FinalizeCode(
2549 *CreateFunction("Test_EmbedStringInCode"), &_assembler_)); 2548 *CreateFunction("Test_EmbedStringInCode"), &_assembler_));
2550 Instructions& instructions = Instructions::Handle(code.instructions()); 2549 Instructions& instructions = Instructions::Handle(code.instructions());
2551 uword retval = 0; 2550 uword retval = 0;
2552 #if defined(USING_SIMULATOR) 2551 #if defined(USING_SIMULATOR)
2553 retval = bit_copy<uword, int64_t>(Simulator::Current()->Call( 2552 retval = bit_copy<uword, int64_t>(Simulator::Current()->Call(
2554 static_cast<int32_t>(instructions.EntryPoint()), 0, 0, 0, 0)); 2553 static_cast<intptr_t>(instructions.EntryPoint()), 0, 0, 0, 0));
2555 #else 2554 #else
2556 typedef uword (*EmbedStringCode)(); 2555 typedef uword (*EmbedStringCode)();
2557 retval = reinterpret_cast<EmbedStringCode>(instructions.EntryPoint())(); 2556 retval = reinterpret_cast<EmbedStringCode>(instructions.EntryPoint())();
2558 #endif 2557 #endif
2559 EXPECT((retval & kSmiTagMask) == kHeapObjectTag); 2558 EXPECT((retval & kSmiTagMask) == kHeapObjectTag);
2560 String& string_object = String::Handle(); 2559 String& string_object = String::Handle();
2561 string_object ^= reinterpret_cast<RawInstructions*>(retval); 2560 string_object ^= reinterpret_cast<RawInstructions*>(retval);
2562 EXPECT(string_object.Length() == expected_length); 2561 EXPECT(string_object.Length() == expected_length);
2563 for (int i = 0; i < expected_length; i ++) { 2562 for (int i = 0; i < expected_length; i ++) {
2564 EXPECT(string_object.CharAt(i) == kHello[i]); 2563 EXPECT(string_object.CharAt(i) == kHello[i]);
2565 } 2564 }
2566 } 2565 }
2567 2566
2568 2567
2569 // Test for Embedded Smi object in the instructions. 2568 // Test for Embedded Smi object in the instructions.
2570 TEST_CASE(EmbedSmiInCode) { 2569 TEST_CASE(EmbedSmiInCode) {
2571 extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value); 2570 extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value);
2572 const intptr_t kSmiTestValue = 5; 2571 const intptr_t kSmiTestValue = 5;
2573 Assembler _assembler_; 2572 Assembler _assembler_;
2574 GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue); 2573 GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue);
2575 Code& code = Code::Handle(Code::FinalizeCode( 2574 Code& code = Code::Handle(Code::FinalizeCode(
2576 *CreateFunction("Test_EmbedSmiInCode"), &_assembler_)); 2575 *CreateFunction("Test_EmbedSmiInCode"), &_assembler_));
2577 Instructions& instructions = Instructions::Handle(code.instructions()); 2576 Instructions& instructions = Instructions::Handle(code.instructions());
2578 intptr_t retval = 0; 2577 intptr_t retval = 0;
2579 #if defined(USING_SIMULATOR) 2578 #if defined(USING_SIMULATOR)
2580 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call( 2579 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
2581 static_cast<int32_t>(instructions.EntryPoint()), 0, 0, 0, 0)); 2580 static_cast<intptr_t>(instructions.EntryPoint()), 0, 0, 0, 0));
2582 #else 2581 #else
2583 typedef intptr_t (*EmbedSmiCode)(); 2582 typedef intptr_t (*EmbedSmiCode)();
2584 retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())(); 2583 retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())();
2585 #endif 2584 #endif
2586 EXPECT((retval >> kSmiTagShift) == kSmiTestValue); 2585 EXPECT((retval >> kSmiTagShift) == kSmiTestValue);
2587 } 2586 }
2588 2587
2589 2588
2590 #if defined(ARCH_IS_64_BIT) 2589 #if defined(ARCH_IS_64_BIT)
2591 // Test for Embedded Smi object in the instructions. 2590 // Test for Embedded Smi object in the instructions.
2592 TEST_CASE(EmbedSmiIn64BitCode) { 2591 TEST_CASE(EmbedSmiIn64BitCode) {
2593 extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value); 2592 extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value);
2594 const intptr_t kSmiTestValue = 5L << 32; 2593 const intptr_t kSmiTestValue = 5L << 32;
2595 Assembler _assembler_; 2594 Assembler _assembler_;
2596 GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue); 2595 GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue);
2597 Code& code = Code::Handle(Code::FinalizeCode( 2596 Code& code = Code::Handle(Code::FinalizeCode(
2598 *CreateFunction("Test_EmbedSmiIn64BitCode"), &_assembler_)); 2597 *CreateFunction("Test_EmbedSmiIn64BitCode"), &_assembler_));
2599 Instructions& instructions = Instructions::Handle(code.instructions()); 2598 Instructions& instructions = Instructions::Handle(code.instructions());
2600 intptr_t retval = 0; 2599 intptr_t retval = 0;
2601 #if defined(USING_SIMULATOR) 2600 #if defined(USING_SIMULATOR)
2602 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call( 2601 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
2603 static_cast<int32_t>(instructions.EntryPoint()), 0, 0, 0, 0)); 2602 static_cast<intptr_t>(instructions.EntryPoint()), 0, 0, 0, 0));
2604 #else 2603 #else
2605 typedef intptr_t (*EmbedSmiCode)(); 2604 typedef intptr_t (*EmbedSmiCode)();
2606 retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())(); 2605 retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())();
2607 #endif 2606 #endif
2608 EXPECT((retval >> kSmiTagShift) == kSmiTestValue); 2607 EXPECT((retval >> kSmiTagShift) == kSmiTestValue);
2609 } 2608 }
2610 #endif // ARCH_IS_64_BIT 2609 #endif // ARCH_IS_64_BIT
2611 2610
2612 2611
2613 TEST_CASE(ExceptionHandlers) { 2612 TEST_CASE(ExceptionHandlers) {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
2986 EXPECT(!String::EqualsIgnoringPrivateKey(ext_mangled_name, 2985 EXPECT(!String::EqualsIgnoringPrivateKey(ext_mangled_name,
2987 ext_bad_bare_name)); 2986 ext_bad_bare_name));
2988 } 2987 }
2989 2988
2990 2989
2991 TEST_CASE(ArrayNew_Overflow_Crash) { 2990 TEST_CASE(ArrayNew_Overflow_Crash) {
2992 Array::Handle(Array::New(Array::kMaxElements + 1)); 2991 Array::Handle(Array::New(Array::kMaxElements + 1));
2993 } 2992 }
2994 2993
2995 2994
2995 // TODO(zra): Enable test when arm64 is ready.
2996 #if !defined(TARGET_ARCH_ARM64)
2997
2996 TEST_CASE(StackTraceFormat) { 2998 TEST_CASE(StackTraceFormat) {
2997 const char* kScriptChars = 2999 const char* kScriptChars =
2998 "void baz() {\n" 3000 "void baz() {\n"
2999 " throw 'MyException';\n" 3001 " throw 'MyException';\n"
3000 "}\n" 3002 "}\n"
3001 "\n" 3003 "\n"
3002 "class _OtherClass {\n" 3004 "class _OtherClass {\n"
3003 " _OtherClass._named() {\n" 3005 " _OtherClass._named() {\n"
3004 " baz();\n" 3006 " baz();\n"
3005 " }\n" 3007 " }\n"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
3046 "#3 _bar (dart:test-lib:16:3)\n" 3048 "#3 _bar (dart:test-lib:16:3)\n"
3047 "#4 MyClass.field (dart:test-lib:25:9)\n" 3049 "#4 MyClass.field (dart:test-lib:25:9)\n"
3048 "#5 MyClass.foo.fooHelper (dart:test-lib:30:7)\n" 3050 "#5 MyClass.foo.fooHelper (dart:test-lib:30:7)\n"
3049 "#6 MyClass.foo (dart:test-lib:32:14)\n" 3051 "#6 MyClass.foo (dart:test-lib:32:14)\n"
3050 "#7 MyClass.MyClass.<anonymous closure> (dart:test-lib:21:15)\n" 3052 "#7 MyClass.MyClass.<anonymous closure> (dart:test-lib:21:15)\n"
3051 "#8 MyClass.MyClass (dart:test-lib:21:18)\n" 3053 "#8 MyClass.MyClass (dart:test-lib:21:18)\n"
3052 "#9 main.<anonymous closure> (dart:test-lib:37:14)\n" 3054 "#9 main.<anonymous closure> (dart:test-lib:37:14)\n"
3053 "#10 main (dart:test-lib:37:24)"); 3055 "#10 main (dart:test-lib:37:24)");
3054 } 3056 }
3055 3057
3058 #endif // !defined(TARGET_ARCH_ARM64)
3056 3059
3057 TEST_CASE(WeakProperty_PreserveCrossGen) { 3060 TEST_CASE(WeakProperty_PreserveCrossGen) {
3058 Isolate* isolate = Isolate::Current(); 3061 Isolate* isolate = Isolate::Current();
3059 WeakProperty& weak = WeakProperty::Handle(); 3062 WeakProperty& weak = WeakProperty::Handle();
3060 { 3063 {
3061 // Weak property and value in new. Key in old. 3064 // Weak property and value in new. Key in old.
3062 HANDLESCOPE(isolate); 3065 HANDLESCOPE(isolate);
3063 String& key = String::Handle(); 3066 String& key = String::Handle();
3064 key ^= OneByteString::New("key", Heap::kOld); 3067 key ^= OneByteString::New("key", Heap::kOld);
3065 String& value = String::Handle(); 3068 String& value = String::Handle();
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
3454 EXPECT_NE(reference.raw(), other_reference.raw()); 3457 EXPECT_NE(reference.raw(), other_reference.raw());
3455 other_reference.set_referent(library); 3458 other_reference.set_referent(library);
3456 EXPECT_NE(reference.raw(), other_reference.raw()); 3459 EXPECT_NE(reference.raw(), other_reference.raw());
3457 EXPECT_EQ(reference.referent(), other_reference.referent()); 3460 EXPECT_EQ(reference.referent(), other_reference.referent());
3458 3461
3459 Object& obj = Object::Handle(reference.raw()); 3462 Object& obj = Object::Handle(reference.raw());
3460 EXPECT(obj.IsMirrorReference()); 3463 EXPECT(obj.IsMirrorReference());
3461 } 3464 }
3462 3465
3463 3466
3467 // TODO(zra): Enable test when arm64 is ready.
3468 #if !defined(TARGET_ARCH_ARM64)
3469
3464 static RawFunction* GetFunction(const Class& cls, const char* name) { 3470 static RawFunction* GetFunction(const Class& cls, const char* name) {
3465 const Function& result = Function::Handle(cls.LookupDynamicFunction( 3471 const Function& result = Function::Handle(cls.LookupDynamicFunction(
3466 String::Handle(String::New(name)))); 3472 String::Handle(String::New(name))));
3467 EXPECT(!result.IsNull()); 3473 EXPECT(!result.IsNull());
3468 return result.raw(); 3474 return result.raw();
3469 } 3475 }
3470 3476
3471 3477
3472 static RawFunction* GetStaticFunction(const Class& cls, const char* name) { 3478 static RawFunction* GetStaticFunction(const Class& cls, const char* name) {
3473 const Function& result = Function::Handle(cls.LookupStaticFunction( 3479 const Function& result = Function::Handle(cls.LookupStaticFunction(
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
3593 func_b_from_index ^= class_a.FunctionFromIndex(func_b_index); 3599 func_b_from_index ^= class_a.FunctionFromIndex(func_b_index);
3594 EXPECT(!func_b_from_index.IsNull()); 3600 EXPECT(!func_b_from_index.IsNull());
3595 // Same function. 3601 // Same function.
3596 EXPECT_EQ(func_b.raw(), func_b_from_index.raw()); 3602 EXPECT_EQ(func_b.raw(), func_b_from_index.raw());
3597 // Retrieve implicit closure function. 3603 // Retrieve implicit closure function.
3598 Function& func_x_from_index = Function::Handle(); 3604 Function& func_x_from_index = Function::Handle();
3599 func_x_from_index ^= class_a.ImplicitClosureFunctionFromIndex(func_x_index); 3605 func_x_from_index ^= class_a.ImplicitClosureFunctionFromIndex(func_x_index);
3600 EXPECT_EQ(func_x.raw(), func_x_from_index.raw()); 3606 EXPECT_EQ(func_x.raw(), func_x_from_index.raw());
3601 } 3607 }
3602 3608
3609 #endif // !defined(TARGET_ARCH_ARM64)
3610
3603 3611
3604 TEST_CASE(FindClosureIndex) { 3612 TEST_CASE(FindClosureIndex) {
3605 // Allocate the class first. 3613 // Allocate the class first.
3606 const String& class_name = String::Handle(Symbols::New("MyClass")); 3614 const String& class_name = String::Handle(Symbols::New("MyClass"));
3607 const Script& script = Script::Handle(); 3615 const Script& script = Script::Handle();
3608 const Class& cls = Class::Handle(CreateDummyClass(class_name, script)); 3616 const Class& cls = Class::Handle(CreateDummyClass(class_name, script));
3609 const Array& functions = Array::Handle(Array::New(1)); 3617 const Array& functions = Array::Handle(Array::New(1));
3610 3618
3611 Function& parent = Function::Handle(); 3619 Function& parent = Function::Handle();
3612 const String& parent_name = String::Handle(Symbols::New("foo_papa")); 3620 const String& parent_name = String::Handle(Symbols::New("foo_papa"));
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
3673 EXPECT_EQ(invocation_dispatcher.raw(), 3681 EXPECT_EQ(invocation_dispatcher.raw(),
3674 invocation_dispatcher_from_index.raw()); 3682 invocation_dispatcher_from_index.raw());
3675 // Test function not found case. 3683 // Test function not found case.
3676 const Function& bad_function = Function::Handle(Function::null()); 3684 const Function& bad_function = Function::Handle(Function::null());
3677 intptr_t bad_invocation_dispatcher_index = 3685 intptr_t bad_invocation_dispatcher_index =
3678 cls.FindInvocationDispatcherFunctionIndex(bad_function); 3686 cls.FindInvocationDispatcherFunctionIndex(bad_function);
3679 EXPECT_EQ(bad_invocation_dispatcher_index, -1); 3687 EXPECT_EQ(bad_invocation_dispatcher_index, -1);
3680 } 3688 }
3681 3689
3682 3690
3691 // TODO(zra): Enable test when arm64 is ready.
3692 #if !defined(TARGET_ARCH_ARM64)
3693
3683 static void PrintMetadata(const char* name, const Object& data) { 3694 static void PrintMetadata(const char* name, const Object& data) {
3684 if (data.IsError()) { 3695 if (data.IsError()) {
3685 OS::Print("Error in metadata evaluation for %s: '%s'\n", 3696 OS::Print("Error in metadata evaluation for %s: '%s'\n",
3686 name, 3697 name,
3687 Error::Cast(data).ToErrorCString()); 3698 Error::Cast(data).ToErrorCString());
3688 } 3699 }
3689 EXPECT(data.IsArray()); 3700 EXPECT(data.IsArray());
3690 const Array& metadata = Array::Cast(data); 3701 const Array& metadata = Array::Cast(data);
3691 OS::Print("Metadata for %s has %" Pd " values:\n", name, metadata.Length()); 3702 OS::Print("Metadata for %s has %" Pd " values:\n", name, metadata.Length());
3692 Object& elem = Object::Handle(); 3703 Object& elem = Object::Handle();
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
3878 EXPECT(func_b.IsInlineable()); 3889 EXPECT(func_b.IsInlineable());
3879 3890
3880 // After setting a breakpoint in a function A.b, it is no longer inlineable. 3891 // After setting a breakpoint in a function A.b, it is no longer inlineable.
3881 SourceBreakpoint* bpt = 3892 SourceBreakpoint* bpt =
3882 Isolate::Current()->debugger()->SetBreakpointAtLine(name, 3893 Isolate::Current()->debugger()->SetBreakpointAtLine(name,
3883 kBreakpointLine); 3894 kBreakpointLine);
3884 ASSERT(bpt != NULL); 3895 ASSERT(bpt != NULL);
3885 EXPECT(!func_b.IsInlineable()); 3896 EXPECT(!func_b.IsInlineable());
3886 } 3897 }
3887 3898
3899 #endif // !defined(TARGET_ARCH_ARM64)
3900
3888 3901
3889 TEST_CASE(SpecialClassesHaveEmptyArrays) { 3902 TEST_CASE(SpecialClassesHaveEmptyArrays) {
3890 ObjectStore* object_store = Isolate::Current()->object_store(); 3903 ObjectStore* object_store = Isolate::Current()->object_store();
3891 Class& cls = Class::Handle(); 3904 Class& cls = Class::Handle();
3892 Object& array = Object::Handle(); 3905 Object& array = Object::Handle();
3893 3906
3894 cls = object_store->null_class(); 3907 cls = object_store->null_class();
3895 array = cls.fields(); 3908 array = cls.fields();
3896 EXPECT(!array.IsNull()); 3909 EXPECT(!array.IsNull());
3897 EXPECT(array.IsArray()); 3910 EXPECT(array.IsArray());
(...skipping 12 matching lines...) Expand all
3910 cls = Object::dynamic_class(); 3923 cls = Object::dynamic_class();
3911 array = cls.fields(); 3924 array = cls.fields();
3912 EXPECT(!array.IsNull()); 3925 EXPECT(!array.IsNull());
3913 EXPECT(array.IsArray()); 3926 EXPECT(array.IsArray());
3914 array = cls.functions(); 3927 array = cls.functions();
3915 EXPECT(!array.IsNull()); 3928 EXPECT(!array.IsNull());
3916 EXPECT(array.IsArray()); 3929 EXPECT(array.IsArray());
3917 } 3930 }
3918 3931
3919 3932
3933 // TODO(zra): Enable test when arm64 is ready.
3934 #if !defined(TARGET_ARCH_ARM64)
3935
3920 TEST_CASE(ToUserCString) { 3936 TEST_CASE(ToUserCString) {
3921 const char* kScriptChars = 3937 const char* kScriptChars =
3922 "var simple = 'simple';\n" 3938 "var simple = 'simple';\n"
3923 "var escapes = 'stuff\\n\\r\\f\\b\\t\\v\\'\"\\$stuff';\n" 3939 "var escapes = 'stuff\\n\\r\\f\\b\\t\\v\\'\"\\$stuff';\n"
3924 "var uescapes = 'stuff\\u0001\\u0002stuff';\n" 3940 "var uescapes = 'stuff\\u0001\\u0002stuff';\n"
3925 "var toolong = " 3941 "var toolong = "
3926 "'01234567890123456789012345678901234567890123456789howdy';\n" 3942 "'01234567890123456789012345678901234567890123456789howdy';\n"
3927 "var toolong2 = " 3943 "var toolong2 = "
3928 "'0123456789012345678901234567890123\\t567890123456789howdy';\n" 3944 "'0123456789012345678901234567890123\\t567890123456789howdy';\n"
3929 "var toolong3 = " 3945 "var toolong3 = "
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
4005 }; 4021 };
4006 4022
4007 4023
4008 TEST_CASE(PrintToJSONStream) { 4024 TEST_CASE(PrintToJSONStream) {
4009 Heap* heap = Isolate::Current()->heap(); 4025 Heap* heap = Isolate::Current()->heap();
4010 heap->CollectAllGarbage(); 4026 heap->CollectAllGarbage();
4011 JSONTypeVerifier verifier; 4027 JSONTypeVerifier verifier;
4012 heap->IterateObjects(&verifier); 4028 heap->IterateObjects(&verifier);
4013 } 4029 }
4014 4030
4031 #endif // !defined(TARGET_ARCH_ARM64)
4032
4015 } // namespace dart 4033 } // namespace dart
4016
4017 #endif // !defined(TARGET_ARCH_ARM64)
OLDNEW
« no previous file with comments | « runtime/vm/object_arm64_test.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698