| 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 TEST(ExternalReferenceEncoder) { | 101 TEST(ExternalReferenceEncoder) { |
| 102 StatsTable::SetCounterFunction(counter_function); | 102 StatsTable::SetCounterFunction(counter_function); |
| 103 Heap::Setup(false); | 103 Heap::Setup(false); |
| 104 ExternalReferenceEncoder encoder; | 104 ExternalReferenceEncoder encoder; |
| 105 CHECK_EQ(make_code(BUILTIN, Builtins::ArrayCode), | 105 CHECK_EQ(make_code(BUILTIN, Builtins::ArrayCode), |
| 106 Encode(encoder, Builtins::ArrayCode)); | 106 Encode(encoder, Builtins::ArrayCode)); |
| 107 CHECK_EQ(make_code(RUNTIME_FUNCTION, Runtime::kAbort), | 107 CHECK_EQ(make_code(v8::internal::RUNTIME_FUNCTION, Runtime::kAbort), |
| 108 Encode(encoder, Runtime::kAbort)); | 108 Encode(encoder, Runtime::kAbort)); |
| 109 CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty), | 109 CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty), |
| 110 Encode(encoder, IC_Utility(IC::kLoadCallbackProperty))); | 110 Encode(encoder, IC_Utility(IC::kLoadCallbackProperty))); |
| 111 ExternalReference keyed_load_function_prototype = | 111 ExternalReference keyed_load_function_prototype = |
| 112 ExternalReference(&Counters::keyed_load_function_prototype); | 112 ExternalReference(&Counters::keyed_load_function_prototype); |
| 113 CHECK_EQ(make_code(STATS_COUNTER, Counters::k_keyed_load_function_prototype), | 113 CHECK_EQ(make_code(STATS_COUNTER, Counters::k_keyed_load_function_prototype), |
| 114 encoder.Encode(keyed_load_function_prototype.address())); | 114 encoder.Encode(keyed_load_function_prototype.address())); |
| 115 ExternalReference the_hole_value_location = | 115 ExternalReference the_hole_value_location = |
| 116 ExternalReference::the_hole_value_location(); | 116 ExternalReference::the_hole_value_location(); |
| 117 CHECK_EQ(make_code(UNCLASSIFIED, 2), | 117 CHECK_EQ(make_code(UNCLASSIFIED, 2), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 135 } | 135 } |
| 136 | 136 |
| 137 | 137 |
| 138 TEST(ExternalReferenceDecoder) { | 138 TEST(ExternalReferenceDecoder) { |
| 139 StatsTable::SetCounterFunction(counter_function); | 139 StatsTable::SetCounterFunction(counter_function); |
| 140 Heap::Setup(false); | 140 Heap::Setup(false); |
| 141 ExternalReferenceDecoder decoder; | 141 ExternalReferenceDecoder decoder; |
| 142 CHECK_EQ(AddressOf(Builtins::ArrayCode), | 142 CHECK_EQ(AddressOf(Builtins::ArrayCode), |
| 143 decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode))); | 143 decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode))); |
| 144 CHECK_EQ(AddressOf(Runtime::kAbort), | 144 CHECK_EQ(AddressOf(Runtime::kAbort), |
| 145 decoder.Decode(make_code(RUNTIME_FUNCTION, Runtime::kAbort))); | 145 decoder.Decode(make_code(v8::internal::RUNTIME_FUNCTION, |
| 146 Runtime::kAbort))); |
| 146 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)), | 147 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)), |
| 147 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty))); | 148 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty))); |
| 148 ExternalReference keyed_load_function = | 149 ExternalReference keyed_load_function = |
| 149 ExternalReference(&Counters::keyed_load_function_prototype); | 150 ExternalReference(&Counters::keyed_load_function_prototype); |
| 150 CHECK_EQ(keyed_load_function.address(), | 151 CHECK_EQ(keyed_load_function.address(), |
| 151 decoder.Decode( | 152 decoder.Decode( |
| 152 make_code(STATS_COUNTER, | 153 make_code(STATS_COUNTER, |
| 153 Counters::k_keyed_load_function_prototype))); | 154 Counters::k_keyed_load_function_prototype))); |
| 154 CHECK_EQ(ExternalReference::the_hole_value_location().address(), | 155 CHECK_EQ(ExternalReference::the_hole_value_location().address(), |
| 155 decoder.Decode(make_code(UNCLASSIFIED, 2))); | 156 decoder.Decode(make_code(UNCLASSIFIED, 2))); |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 TEST(TestThatAlwaysFails) { | 669 TEST(TestThatAlwaysFails) { |
| 669 bool ArtificialFailure = false; | 670 bool ArtificialFailure = false; |
| 670 CHECK(ArtificialFailure); | 671 CHECK(ArtificialFailure); |
| 671 } | 672 } |
| 672 | 673 |
| 673 | 674 |
| 674 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 675 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
| 675 bool ArtificialFailure2 = false; | 676 bool ArtificialFailure2 = false; |
| 676 CHECK(ArtificialFailure2); | 677 CHECK(ArtificialFailure2); |
| 677 } | 678 } |
| OLD | NEW |