| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |