OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 __ li(v0, Operand(key)); | 144 __ li(v0, Operand(key)); |
145 __ GetNumberHash(v0, t1); | 145 __ GetNumberHash(v0, t1); |
146 __ pop(kRootRegister); | 146 __ pop(kRootRegister); |
147 __ jr(ra); | 147 __ jr(ra); |
148 __ nop(); | 148 __ nop(); |
149 #endif | 149 #endif |
150 } | 150 } |
151 | 151 |
152 | 152 |
153 void check(i::Vector<const uint8_t> string) { | 153 void check(i::Vector<const uint8_t> string) { |
154 Isolate* isolate = Isolate::Current(); | 154 Isolate* isolate = CcTest::i_isolate(); |
155 Factory* factory = isolate->factory(); | 155 Factory* factory = isolate->factory(); |
156 HandleScope scope(isolate); | 156 HandleScope scope(isolate); |
157 | 157 |
158 v8::internal::byte buffer[2048]; | 158 v8::internal::byte buffer[2048]; |
159 MacroAssembler masm(isolate, buffer, sizeof buffer); | 159 MacroAssembler masm(isolate, buffer, sizeof buffer); |
160 | 160 |
161 generate(&masm, string); | 161 generate(&masm, string); |
162 | 162 |
163 CodeDesc desc; | 163 CodeDesc desc; |
164 masm.GetCode(&desc); | 164 masm.GetCode(&desc); |
(...skipping 16 matching lines...) Expand all Loading... |
181 CHECK(runtime_hash == codegen_hash); | 181 CHECK(runtime_hash == codegen_hash); |
182 } | 182 } |
183 | 183 |
184 | 184 |
185 void check(i::Vector<const char> s) { | 185 void check(i::Vector<const char> s) { |
186 check(i::Vector<const uint8_t>::cast(s)); | 186 check(i::Vector<const uint8_t>::cast(s)); |
187 } | 187 } |
188 | 188 |
189 | 189 |
190 void check(uint32_t key) { | 190 void check(uint32_t key) { |
191 Isolate* isolate = Isolate::Current(); | 191 Isolate* isolate = CcTest::i_isolate(); |
192 Factory* factory = isolate->factory(); | 192 Factory* factory = isolate->factory(); |
193 HandleScope scope(isolate); | 193 HandleScope scope(isolate); |
194 | 194 |
195 v8::internal::byte buffer[2048]; | 195 v8::internal::byte buffer[2048]; |
196 MacroAssembler masm(Isolate::Current(), buffer, sizeof buffer); | 196 MacroAssembler masm(CcTest::i_isolate(), buffer, sizeof buffer); |
197 | 197 |
198 generate(&masm, key); | 198 generate(&masm, key); |
199 | 199 |
200 CodeDesc desc; | 200 CodeDesc desc; |
201 masm.GetCode(&desc); | 201 masm.GetCode(&desc); |
202 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate); | 202 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate); |
203 Handle<Code> code = factory->NewCode(desc, | 203 Handle<Code> code = factory->NewCode(desc, |
204 Code::ComputeFlags(Code::STUB), | 204 Code::ComputeFlags(Code::STUB), |
205 undefined); | 205 undefined); |
206 CHECK(code->IsCode()); | 206 CHECK(code->IsCode()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // Some pseudo-random numbers | 263 // Some pseudo-random numbers |
264 static const uint32_t kLimit = 1000; | 264 static const uint32_t kLimit = 1000; |
265 for (uint32_t i = 0; i < 5; i++) { | 265 for (uint32_t i = 0; i < 5; i++) { |
266 for (uint32_t j = 0; j < 5; j++) { | 266 for (uint32_t j = 0; j < 5; j++) { |
267 check(PseudoRandom(i, j) % kLimit); | 267 check(PseudoRandom(i, j) % kLimit); |
268 } | 268 } |
269 } | 269 } |
270 } | 270 } |
271 | 271 |
272 #undef __ | 272 #undef __ |
OLD | NEW |