| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 CodeDesc desc; | 120 CodeDesc desc; |
| 121 masm.GetCode(&desc); | 121 masm.GetCode(&desc); |
| 122 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate); | 122 Handle<Object> undefined(isolate->heap()->undefined_value(), isolate); |
| 123 Handle<Code> code = factory->NewCode(desc, | 123 Handle<Code> code = factory->NewCode(desc, |
| 124 Code::ComputeFlags(Code::STUB), | 124 Code::ComputeFlags(Code::STUB), |
| 125 undefined); | 125 undefined); |
| 126 CHECK(code->IsCode()); | 126 CHECK(code->IsCode()); |
| 127 | 127 |
| 128 HASH_FUNCTION hash = FUNCTION_CAST<HASH_FUNCTION>(code->entry()); | 128 HASH_FUNCTION hash = FUNCTION_CAST<HASH_FUNCTION>(code->entry()); |
| 129 #ifdef USE_SIMULATOR | 129 #ifdef USE_SIMULATOR |
| 130 uint32_t codegen_hash = static_cast<uint32_t>( | 130 uint32_t codegen_hash = static_cast<uint32_t>(reinterpret_cast<uintptr_t>( |
| 131 reinterpret_cast<uintptr_t>(CALL_GENERATED_CODE(hash, 0, 0, 0, 0, 0))); | 131 CALL_GENERATED_CODE(isolate, hash, 0, 0, 0, 0, 0))); |
| 132 #else | 132 #else |
| 133 uint32_t codegen_hash = hash(); | 133 uint32_t codegen_hash = hash(); |
| 134 #endif | 134 #endif |
| 135 | 135 |
| 136 uint32_t runtime_hash = ComputeIntegerHash(key, isolate->heap()->HashSeed()); | 136 uint32_t runtime_hash = ComputeIntegerHash(key, isolate->heap()->HashSeed()); |
| 137 CHECK_EQ(runtime_hash, codegen_hash); | 137 CHECK_EQ(runtime_hash, codegen_hash); |
| 138 } | 138 } |
| 139 | 139 |
| 140 | 140 |
| 141 static uint32_t PseudoRandom(uint32_t i, uint32_t j) { | 141 static uint32_t PseudoRandom(uint32_t i, uint32_t j) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 156 // Some pseudo-random numbers | 156 // Some pseudo-random numbers |
| 157 static const uint32_t kLimit = 1000; | 157 static const uint32_t kLimit = 1000; |
| 158 for (uint32_t i = 0; i < 5; i++) { | 158 for (uint32_t i = 0; i < 5; i++) { |
| 159 for (uint32_t j = 0; j < 5; j++) { | 159 for (uint32_t j = 0; j < 5; j++) { |
| 160 check(PseudoRandom(i, j) % kLimit); | 160 check(PseudoRandom(i, j) % kLimit); |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 #undef __ | 165 #undef __ |
| OLD | NEW |