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

Side by Side Diff: test/cctest/test-serialize.cc

Issue 2817018: [Isolates] StatsTable moved to Isolate.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 years, 6 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 | « src/isolate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007-2010 the V8 project authors. All rights reserved. 1 // Copyright 2007-2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return static_cast<uint32_t>(type) << kReferenceTypeShift | id; 97 return static_cast<uint32_t>(type) << kReferenceTypeShift | id;
98 } 98 }
99 99
100 100
101 static int register_code(int reg) { 101 static int register_code(int reg) {
102 return Debug::k_register_address << kDebugIdShift | reg; 102 return Debug::k_register_address << kDebugIdShift | reg;
103 } 103 }
104 104
105 105
106 TEST(ExternalReferenceEncoder) { 106 TEST(ExternalReferenceEncoder) {
107 StatsTable::SetCounterFunction(counter_function); 107 i::Isolate::Current()->stats_table()->SetCounterFunction(counter_function);
108 HEAP->Setup(false); 108 HEAP->Setup(false);
109 ExternalReferenceEncoder encoder; 109 ExternalReferenceEncoder encoder;
110 CHECK_EQ(make_code(BUILTIN, Builtins::ArrayCode), 110 CHECK_EQ(make_code(BUILTIN, Builtins::ArrayCode),
111 Encode(encoder, Builtins::ArrayCode)); 111 Encode(encoder, Builtins::ArrayCode));
112 CHECK_EQ(make_code(RUNTIME_FUNCTION, Runtime::kAbort), 112 CHECK_EQ(make_code(RUNTIME_FUNCTION, Runtime::kAbort),
113 Encode(encoder, Runtime::kAbort)); 113 Encode(encoder, Runtime::kAbort));
114 CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty), 114 CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty),
115 Encode(encoder, IC_Utility(IC::kLoadCallbackProperty))); 115 Encode(encoder, IC_Utility(IC::kLoadCallbackProperty)));
116 CHECK_EQ(make_code(DEBUG_ADDRESS, register_code(3)), 116 CHECK_EQ(make_code(DEBUG_ADDRESS, register_code(3)),
117 Encode(encoder, Debug_Address(Debug::k_register_address, 3))); 117 Encode(encoder, Debug_Address(Debug::k_register_address, 3)));
(...skipping 16 matching lines...) Expand all
134 CHECK_EQ(make_code(UNCLASSIFIED, 15), 134 CHECK_EQ(make_code(UNCLASSIFIED, 15),
135 encoder.Encode(ExternalReference::debug_break().address())); 135 encoder.Encode(ExternalReference::debug_break().address()));
136 CHECK_EQ(make_code(UNCLASSIFIED, 10), 136 CHECK_EQ(make_code(UNCLASSIFIED, 10),
137 encoder.Encode(ExternalReference::new_space_start().address())); 137 encoder.Encode(ExternalReference::new_space_start().address()));
138 CHECK_EQ(make_code(UNCLASSIFIED, 3), 138 CHECK_EQ(make_code(UNCLASSIFIED, 3),
139 encoder.Encode(ExternalReference::roots_address().address())); 139 encoder.Encode(ExternalReference::roots_address().address()));
140 } 140 }
141 141
142 142
143 TEST(ExternalReferenceDecoder) { 143 TEST(ExternalReferenceDecoder) {
144 StatsTable::SetCounterFunction(counter_function); 144 i::Isolate::Current()->stats_table()->SetCounterFunction(counter_function);
145 HEAP->Setup(false); 145 HEAP->Setup(false);
146 ExternalReferenceDecoder decoder; 146 ExternalReferenceDecoder decoder;
147 CHECK_EQ(AddressOf(Builtins::ArrayCode), 147 CHECK_EQ(AddressOf(Builtins::ArrayCode),
148 decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode))); 148 decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode)));
149 CHECK_EQ(AddressOf(Runtime::kAbort), 149 CHECK_EQ(AddressOf(Runtime::kAbort),
150 decoder.Decode(make_code(RUNTIME_FUNCTION, Runtime::kAbort))); 150 decoder.Decode(make_code(RUNTIME_FUNCTION, Runtime::kAbort)));
151 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)), 151 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)),
152 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty))); 152 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty)));
153 CHECK_EQ(AddressOf(Debug_Address(Debug::k_register_address, 3)), 153 CHECK_EQ(AddressOf(Debug_Address(Debug::k_register_address, 3)),
154 decoder.Decode(make_code(DEBUG_ADDRESS, register_code(3)))); 154 decoder.Decode(make_code(DEBUG_ADDRESS, register_code(3))));
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 TEST(TestThatAlwaysFails) { 659 TEST(TestThatAlwaysFails) {
660 bool ArtificialFailure = false; 660 bool ArtificialFailure = false;
661 CHECK(ArtificialFailure); 661 CHECK(ArtificialFailure);
662 } 662 }
663 663
664 664
665 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { 665 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) {
666 bool ArtificialFailure2 = false; 666 bool ArtificialFailure2 = false;
667 CHECK(ArtificialFailure2); 667 CHECK(ArtificialFailure2);
668 } 668 }
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698