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

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

Issue 10832150: Get rid of ast node ids. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/assembler.h" 6 #include "vm/assembler.h"
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after
2529 GenerateIncrement(&_assembler_); 2529 GenerateIncrement(&_assembler_);
2530 Code& code = Code::Handle(Code::FinalizeCode( 2530 Code& code = Code::Handle(Code::FinalizeCode(
2531 *CreateFunction("Test_Code"), &_assembler_)); 2531 *CreateFunction("Test_Code"), &_assembler_));
2532 code.set_pc_descriptors(descriptors); 2532 code.set_pc_descriptors(descriptors);
2533 2533
2534 // Verify the PcDescriptor entries by accessing them. 2534 // Verify the PcDescriptor entries by accessing them.
2535 const PcDescriptors& pc_descs = PcDescriptors::Handle(code.pc_descriptors()); 2535 const PcDescriptors& pc_descs = PcDescriptors::Handle(code.pc_descriptors());
2536 EXPECT_EQ(kNumEntries, pc_descs.Length()); 2536 EXPECT_EQ(kNumEntries, pc_descs.Length());
2537 EXPECT_EQ(1, pc_descs.TryIndex(0)); 2537 EXPECT_EQ(1, pc_descs.TryIndex(0));
2538 EXPECT_EQ(static_cast<uword>(10), pc_descs.PC(0)); 2538 EXPECT_EQ(static_cast<uword>(10), pc_descs.PC(0));
2539 EXPECT_EQ(1, pc_descs.NodeId(0)); 2539 EXPECT_EQ(1, pc_descs.DeoptId(0));
2540 EXPECT_EQ(20, pc_descs.TokenIndex(0)); 2540 EXPECT_EQ(20, pc_descs.TokenPos(0));
2541 EXPECT_EQ(3, pc_descs.TryIndex(5)); 2541 EXPECT_EQ(3, pc_descs.TryIndex(5));
2542 EXPECT_EQ(static_cast<uword>(80), pc_descs.PC(5)); 2542 EXPECT_EQ(static_cast<uword>(80), pc_descs.PC(5));
2543 EXPECT_EQ(150, pc_descs.TokenIndex(5)); 2543 EXPECT_EQ(150, pc_descs.TokenPos(5));
2544 EXPECT_EQ(PcDescriptors::kOther, pc_descs.DescriptorKind(0)); 2544 EXPECT_EQ(PcDescriptors::kOther, pc_descs.DescriptorKind(0));
2545 EXPECT_EQ(PcDescriptors::kDeopt, pc_descs.DescriptorKind(1)); 2545 EXPECT_EQ(PcDescriptors::kDeopt, pc_descs.DescriptorKind(1));
2546 } 2546 }
2547 2547
2548 2548
2549 static RawClass* CreateTestClass(const char* name) { 2549 static RawClass* CreateTestClass(const char* name) {
2550 const String& class_name = String::Handle(Symbols::New(name)); 2550 const String& class_name = String::Handle(Symbols::New(name));
2551 const Class& cls = Class::Handle( 2551 const Class& cls = Class::Handle(
2552 Class::New(class_name, Script::Handle(), Scanner::kDummyTokenIndex)); 2552 Class::New(class_name, Script::Handle(), Scanner::kDummyTokenIndex));
2553 return cls.raw(); 2553 return cls.raw();
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2804 2804
2805 2805
2806 TEST_CASE(ArrayNew_Overflow_Crash) { 2806 TEST_CASE(ArrayNew_Overflow_Crash) {
2807 Array::Handle(Array::New(Array::kMaxElements + 1)); 2807 Array::Handle(Array::New(Array::kMaxElements + 1));
2808 } 2808 }
2809 2809
2810 2810
2811 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 2811 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
2812 2812
2813 } // namespace dart 2813 } // namespace dart
OLDNEW
« runtime/vm/isolate.h ('K') | « runtime/vm/object.cc ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698