| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 CHECK_EQ(make_code(STATS_COUNTER, Counters::k_keyed_load_function_prototype), | 116 CHECK_EQ(make_code(STATS_COUNTER, Counters::k_keyed_load_function_prototype), |
| 117 encoder.Encode(keyed_load_function_prototype.address())); | 117 encoder.Encode(keyed_load_function_prototype.address())); |
| 118 ExternalReference passed_function = | 118 ExternalReference passed_function = |
| 119 ExternalReference::builtin_passed_function(); | 119 ExternalReference::builtin_passed_function(); |
| 120 CHECK_EQ(make_code(UNCLASSIFIED, 1), | 120 CHECK_EQ(make_code(UNCLASSIFIED, 1), |
| 121 encoder.Encode(passed_function.address())); | 121 encoder.Encode(passed_function.address())); |
| 122 ExternalReference the_hole_value_location = | 122 ExternalReference the_hole_value_location = |
| 123 ExternalReference::the_hole_value_location(); | 123 ExternalReference::the_hole_value_location(); |
| 124 CHECK_EQ(make_code(UNCLASSIFIED, 2), | 124 CHECK_EQ(make_code(UNCLASSIFIED, 2), |
| 125 encoder.Encode(the_hole_value_location.address())); | 125 encoder.Encode(the_hole_value_location.address())); |
| 126 ExternalReference stack_guard_limit_address = | 126 ExternalReference stack_limit_address = |
| 127 ExternalReference::address_of_stack_guard_limit(); | 127 ExternalReference::address_of_stack_limit(); |
| 128 CHECK_EQ(make_code(UNCLASSIFIED, 4), | 128 CHECK_EQ(make_code(UNCLASSIFIED, 4), |
| 129 encoder.Encode(stack_guard_limit_address.address())); | 129 encoder.Encode(stack_limit_address.address())); |
| 130 CHECK_EQ(make_code(UNCLASSIFIED, 10), | 130 ExternalReference real_stack_limit_address = |
| 131 ExternalReference::address_of_real_stack_limit(); |
| 132 CHECK_EQ(make_code(UNCLASSIFIED, 5), |
| 133 encoder.Encode(real_stack_limit_address.address())); |
| 134 CHECK_EQ(make_code(UNCLASSIFIED, 11), |
| 131 encoder.Encode(ExternalReference::debug_break().address())); | 135 encoder.Encode(ExternalReference::debug_break().address())); |
| 132 CHECK_EQ(make_code(UNCLASSIFIED, 6), | 136 CHECK_EQ(make_code(UNCLASSIFIED, 7), |
| 133 encoder.Encode(ExternalReference::new_space_start().address())); | 137 encoder.Encode(ExternalReference::new_space_start().address())); |
| 134 CHECK_EQ(make_code(UNCLASSIFIED, 3), | 138 CHECK_EQ(make_code(UNCLASSIFIED, 3), |
| 135 encoder.Encode(ExternalReference::roots_address().address())); | 139 encoder.Encode(ExternalReference::roots_address().address())); |
| 136 } | 140 } |
| 137 | 141 |
| 138 | 142 |
| 139 TEST(ExternalReferenceDecoder) { | 143 TEST(ExternalReferenceDecoder) { |
| 140 StatsTable::SetCounterFunction(counter_function); | 144 StatsTable::SetCounterFunction(counter_function); |
| 141 Heap::Setup(false); | 145 Heap::Setup(false); |
| 142 ExternalReferenceDecoder decoder; | 146 ExternalReferenceDecoder decoder; |
| 143 CHECK_EQ(AddressOf(Builtins::ArrayCode), | 147 CHECK_EQ(AddressOf(Builtins::ArrayCode), |
| 144 decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode))); | 148 decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode))); |
| 145 CHECK_EQ(AddressOf(Runtime::kAbort), | 149 CHECK_EQ(AddressOf(Runtime::kAbort), |
| 146 decoder.Decode(make_code(RUNTIME_FUNCTION, Runtime::kAbort))); | 150 decoder.Decode(make_code(RUNTIME_FUNCTION, Runtime::kAbort))); |
| 147 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)), | 151 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)), |
| 148 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty))); | 152 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty))); |
| 149 CHECK_EQ(AddressOf(Debug_Address(Debug::k_register_address, 3)), | 153 CHECK_EQ(AddressOf(Debug_Address(Debug::k_register_address, 3)), |
| 150 decoder.Decode(make_code(DEBUG_ADDRESS, register_code(3)))); | 154 decoder.Decode(make_code(DEBUG_ADDRESS, register_code(3)))); |
| 151 ExternalReference keyed_load_function = | 155 ExternalReference keyed_load_function = |
| 152 ExternalReference(&Counters::keyed_load_function_prototype); | 156 ExternalReference(&Counters::keyed_load_function_prototype); |
| 153 CHECK_EQ(keyed_load_function.address(), | 157 CHECK_EQ(keyed_load_function.address(), |
| 154 decoder.Decode( | 158 decoder.Decode( |
| 155 make_code(STATS_COUNTER, | 159 make_code(STATS_COUNTER, |
| 156 Counters::k_keyed_load_function_prototype))); | 160 Counters::k_keyed_load_function_prototype))); |
| 157 CHECK_EQ(ExternalReference::builtin_passed_function().address(), | 161 CHECK_EQ(ExternalReference::builtin_passed_function().address(), |
| 158 decoder.Decode(make_code(UNCLASSIFIED, 1))); | 162 decoder.Decode(make_code(UNCLASSIFIED, 1))); |
| 159 CHECK_EQ(ExternalReference::the_hole_value_location().address(), | 163 CHECK_EQ(ExternalReference::the_hole_value_location().address(), |
| 160 decoder.Decode(make_code(UNCLASSIFIED, 2))); | 164 decoder.Decode(make_code(UNCLASSIFIED, 2))); |
| 161 CHECK_EQ(ExternalReference::address_of_stack_guard_limit().address(), | 165 CHECK_EQ(ExternalReference::address_of_stack_limit().address(), |
| 162 decoder.Decode(make_code(UNCLASSIFIED, 4))); | 166 decoder.Decode(make_code(UNCLASSIFIED, 4))); |
| 167 CHECK_EQ(ExternalReference::address_of_real_stack_limit().address(), |
| 168 decoder.Decode(make_code(UNCLASSIFIED, 5))); |
| 163 CHECK_EQ(ExternalReference::debug_break().address(), | 169 CHECK_EQ(ExternalReference::debug_break().address(), |
| 164 decoder.Decode(make_code(UNCLASSIFIED, 10))); | 170 decoder.Decode(make_code(UNCLASSIFIED, 11))); |
| 165 CHECK_EQ(ExternalReference::new_space_start().address(), | 171 CHECK_EQ(ExternalReference::new_space_start().address(), |
| 166 decoder.Decode(make_code(UNCLASSIFIED, 6))); | 172 decoder.Decode(make_code(UNCLASSIFIED, 7))); |
| 167 } | 173 } |
| 168 | 174 |
| 169 | 175 |
| 170 static void Serialize() { | 176 static void Serialize() { |
| 171 #ifdef DEBUG | 177 #ifdef DEBUG |
| 172 FLAG_debug_serialization = true; | 178 FLAG_debug_serialization = true; |
| 173 #endif | 179 #endif |
| 174 StatsTable::SetCounterFunction(counter_function); | 180 StatsTable::SetCounterFunction(counter_function); |
| 175 | 181 |
| 176 v8::HandleScope scope; | 182 v8::HandleScope scope; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 TEST(TestThatAlwaysFails) { | 346 TEST(TestThatAlwaysFails) { |
| 341 bool ArtificialFailure = false; | 347 bool ArtificialFailure = false; |
| 342 CHECK(ArtificialFailure); | 348 CHECK(ArtificialFailure); |
| 343 } | 349 } |
| 344 | 350 |
| 345 | 351 |
| 346 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 352 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
| 347 bool ArtificialFailure2 = false; | 353 bool ArtificialFailure2 = false; |
| 348 CHECK(ArtificialFailure2); | 354 CHECK(ArtificialFailure2); |
| 349 } | 355 } |
| OLD | NEW |