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 OS::Setup(); | 102 OS::Setup(); |
103 Isolate* isolate = i::Isolate::Current(); | 103 Isolate* isolate = i::Isolate::Current(); |
104 isolate->stats_table()->SetCounterFunction(counter_function); | 104 isolate->stats_table()->SetCounterFunction(counter_function); |
105 HEAP->Setup(false); | 105 HEAP->Setup(false); |
106 ExternalReferenceEncoder encoder; | 106 ExternalReferenceEncoder encoder; |
107 CHECK_EQ(make_code(BUILTIN, Builtins::ArrayCode), | 107 CHECK_EQ(make_code(BUILTIN, Builtins::kArrayCode), |
108 Encode(encoder, Builtins::ArrayCode)); | 108 Encode(encoder, Builtins::kArrayCode)); |
109 CHECK_EQ(make_code(v8::internal::RUNTIME_FUNCTION, Runtime::kAbort), | 109 CHECK_EQ(make_code(v8::internal::RUNTIME_FUNCTION, Runtime::kAbort), |
110 Encode(encoder, Runtime::kAbort)); | 110 Encode(encoder, Runtime::kAbort)); |
111 CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty), | 111 CHECK_EQ(make_code(IC_UTILITY, IC::kLoadCallbackProperty), |
112 Encode(encoder, IC_Utility(IC::kLoadCallbackProperty))); | 112 Encode(encoder, IC_Utility(IC::kLoadCallbackProperty))); |
113 ExternalReference keyed_load_function_prototype = | 113 ExternalReference keyed_load_function_prototype = |
114 ExternalReference(isolate->counters()->keyed_load_function_prototype()); | 114 ExternalReference(isolate->counters()->keyed_load_function_prototype()); |
115 CHECK_EQ(make_code(STATS_COUNTER, Counters::k_keyed_load_function_prototype), | 115 CHECK_EQ(make_code(STATS_COUNTER, Counters::k_keyed_load_function_prototype), |
116 encoder.Encode(keyed_load_function_prototype.address())); | 116 encoder.Encode(keyed_load_function_prototype.address())); |
117 ExternalReference the_hole_value_location = | 117 ExternalReference the_hole_value_location = |
118 ExternalReference::the_hole_value_location(isolate); | 118 ExternalReference::the_hole_value_location(isolate); |
(...skipping 18 matching lines...) Expand all Loading... |
137 encoder.Encode(ExternalReference::roots_address(isolate).address())); | 137 encoder.Encode(ExternalReference::roots_address(isolate).address())); |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 TEST(ExternalReferenceDecoder) { | 141 TEST(ExternalReferenceDecoder) { |
142 OS::Setup(); | 142 OS::Setup(); |
143 Isolate* isolate = i::Isolate::Current(); | 143 Isolate* isolate = i::Isolate::Current(); |
144 isolate->stats_table()->SetCounterFunction(counter_function); | 144 isolate->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::kArrayCode), |
148 decoder.Decode(make_code(BUILTIN, Builtins::ArrayCode))); | 148 decoder.Decode(make_code(BUILTIN, Builtins::kArrayCode))); |
149 CHECK_EQ(AddressOf(Runtime::kAbort), | 149 CHECK_EQ(AddressOf(Runtime::kAbort), |
150 decoder.Decode(make_code(v8::internal::RUNTIME_FUNCTION, | 150 decoder.Decode(make_code(v8::internal::RUNTIME_FUNCTION, |
151 Runtime::kAbort))); | 151 Runtime::kAbort))); |
152 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)), | 152 CHECK_EQ(AddressOf(IC_Utility(IC::kLoadCallbackProperty)), |
153 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty))); | 153 decoder.Decode(make_code(IC_UTILITY, IC::kLoadCallbackProperty))); |
154 ExternalReference keyed_load_function = | 154 ExternalReference keyed_load_function = |
155 ExternalReference(isolate->counters()->keyed_load_function_prototype()); | 155 ExternalReference(isolate->counters()->keyed_load_function_prototype()); |
156 CHECK_EQ(keyed_load_function.address(), | 156 CHECK_EQ(keyed_load_function.address(), |
157 decoder.Decode( | 157 decoder.Decode( |
158 make_code(STATS_COUNTER, | 158 make_code(STATS_COUNTER, |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 TEST(TestThatAlwaysFails) { | 670 TEST(TestThatAlwaysFails) { |
671 bool ArtificialFailure = false; | 671 bool ArtificialFailure = false; |
672 CHECK(ArtificialFailure); | 672 CHECK(ArtificialFailure); |
673 } | 673 } |
674 | 674 |
675 | 675 |
676 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 676 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
677 bool ArtificialFailure2 = false; | 677 bool ArtificialFailure2 = false; |
678 CHECK(ArtificialFailure2); | 678 CHECK(ArtificialFailure2); |
679 } | 679 } |
OLD | NEW |