| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 | 100 |
| 101 #ifdef ENABLE_DEBUGGER_SUPPORT | 101 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 102 static int register_code(int reg) { | 102 static int register_code(int reg) { |
| 103 return Debug::k_register_address << kDebugIdShift | reg; | 103 return Debug::k_register_address << kDebugIdShift | reg; |
| 104 } | 104 } |
| 105 #endif // ENABLE_DEBUGGER_SUPPORT | 105 #endif // ENABLE_DEBUGGER_SUPPORT |
| 106 | 106 |
| 107 | 107 |
| 108 TEST(ExternalReferenceEncoder) { | 108 TEST(ExternalReferenceEncoder) { |
| 109 OS::Setup(); |
| 109 i::Isolate::Current()->stats_table()->SetCounterFunction(counter_function); | 110 i::Isolate::Current()->stats_table()->SetCounterFunction(counter_function); |
| 110 HEAP->Setup(false); | 111 HEAP->Setup(false); |
| 111 ExternalReferenceEncoder encoder; | 112 ExternalReferenceEncoder encoder; |
| 112 CHECK_EQ(make_code(BUILTIN, Builtins::ArrayCode), | 113 CHECK_EQ(make_code(BUILTIN, Builtins::ArrayCode), |
| 113 Encode(encoder, Builtins::ArrayCode)); | 114 Encode(encoder, Builtins::ArrayCode)); |
| 114 CHECK_EQ(make_code(RUNTIME_FUNCTION, Runtime::kAbort), | 115 CHECK_EQ(make_code(RUNTIME_FUNCTION, Runtime::kAbort), |
| 115 Encode(encoder, Runtime::kAbort)); | 116 Encode(encoder, Runtime::kAbort)); |
| 116 CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty), | 117 CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty), |
| 117 Encode(encoder, IC_Utility(IC::kLoadCallbackProperty))); | 118 Encode(encoder, IC_Utility(IC::kLoadCallbackProperty))); |
| 118 #ifdef ENABLE_DEBUGGER_SUPPORT | 119 #ifdef ENABLE_DEBUGGER_SUPPORT |
| (...skipping 21 matching lines...) Expand all Loading... |
| 140 encoder.Encode(ExternalReference::debug_break().address())); | 141 encoder.Encode(ExternalReference::debug_break().address())); |
| 141 #endif // ENABLE_DEBUGGER_SUPPORT | 142 #endif // ENABLE_DEBUGGER_SUPPORT |
| 142 CHECK_EQ(make_code(UNCLASSIFIED, 10), | 143 CHECK_EQ(make_code(UNCLASSIFIED, 10), |
| 143 encoder.Encode(ExternalReference::new_space_start().address())); | 144 encoder.Encode(ExternalReference::new_space_start().address())); |
| 144 CHECK_EQ(make_code(UNCLASSIFIED, 3), | 145 CHECK_EQ(make_code(UNCLASSIFIED, 3), |
| 145 encoder.Encode(ExternalReference::roots_address().address())); | 146 encoder.Encode(ExternalReference::roots_address().address())); |
| 146 } | 147 } |
| 147 | 148 |
| 148 | 149 |
| 149 TEST(ExternalReferenceDecoder) { | 150 TEST(ExternalReferenceDecoder) { |
| 151 OS::Setup(); |
| 150 i::Isolate::Current()->stats_table()->SetCounterFunction(counter_function); | 152 i::Isolate::Current()->stats_table()->SetCounterFunction(counter_function); |
| 151 HEAP->Setup(false); | 153 HEAP->Setup(false); |
| 152 ExternalReferenceDecoder decoder; | 154 ExternalReferenceDecoder decoder; |
| 153 CHECK_EQ(AddressOf(Builtins::ArrayCode), | 155 CHECK_EQ(AddressOf(Builtins::ArrayCode), |
| 154 decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode))); | 156 decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode))); |
| 155 CHECK_EQ(AddressOf(Runtime::kAbort), | 157 CHECK_EQ(AddressOf(Runtime::kAbort), |
| 156 decoder.Decode(make_code(RUNTIME_FUNCTION, Runtime::kAbort))); | 158 decoder.Decode(make_code(RUNTIME_FUNCTION, Runtime::kAbort))); |
| 157 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)), | 159 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)), |
| 158 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty))); | 160 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty))); |
| 159 #ifdef ENABLE_DEBUGGER_SUPPORT | 161 #ifdef ENABLE_DEBUGGER_SUPPORT |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 TEST(TestThatAlwaysFails) { | 671 TEST(TestThatAlwaysFails) { |
| 670 bool ArtificialFailure = false; | 672 bool ArtificialFailure = false; |
| 671 CHECK(ArtificialFailure); | 673 CHECK(ArtificialFailure); |
| 672 } | 674 } |
| 673 | 675 |
| 674 | 676 |
| 675 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 677 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
| 676 bool ArtificialFailure2 = false; | 678 bool ArtificialFailure2 = false; |
| 677 CHECK(ArtificialFailure2); | 679 CHECK(ArtificialFailure2); |
| 678 } | 680 } |
| OLD | NEW |