| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <iostream> // NOLINT(readability/streams) | 5 #include <iostream> // NOLINT(readability/streams) |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
| 9 | 9 |
| 10 #include "src/arm64/simulator-arm64.h" | 10 #include "src/arm64/simulator-arm64.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 CSignature0<int64_t> csig; | 45 CSignature0<int64_t> csig; |
| 46 CodeRunner<int64_t> runnable(isolate, code, &csig); | 46 CodeRunner<int64_t> runnable(isolate, code, &csig); |
| 47 int64_t ret_value = runnable.Call(); | 47 int64_t ret_value = runnable.Call(); |
| 48 CHECK_EQ(ret_value, imm); | 48 CHECK_EQ(ret_value, imm); |
| 49 | 49 |
| 50 #ifdef DEBUG | 50 #ifdef DEBUG |
| 51 OFStream os(stdout); | 51 OFStream os(stdout); |
| 52 code->Print(os); | 52 code->Print(os); |
| 53 ::printf("f() = %" PRIx64 "\n\n", ret_value); | 53 ::printf("f() = %" PRIx64 "\n\n", ret_value); |
| 54 #endif | 54 #endif |
| 55 size_t offset = 1234; | 55 int offset = 1234; |
| 56 | 56 |
| 57 // Relocating reference by offset | 57 // Relocating reference by offset |
| 58 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); | 58 int mode_mask = (1 << RelocInfo::WASM_MEMORY_REFERENCE); |
| 59 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 59 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
| 60 RelocInfo::Mode mode = it.rinfo()->rmode(); | 60 RelocInfo::Mode mode = it.rinfo()->rmode(); |
| 61 if (RelocInfo::IsWasmMemoryReference(mode)) { | 61 if (RelocInfo::IsWasmMemoryReference(mode)) { |
| 62 // Dummy values of size used here as the objective of the test is to | 62 // Dummy values of size used here as the objective of the test is to |
| 63 // verify that the immediate is patched correctly | 63 // verify that the immediate is patched correctly |
| 64 it.rinfo()->update_wasm_memory_reference( | 64 it.rinfo()->update_wasm_memory_reference( |
| 65 it.rinfo()->wasm_memory_reference(), | 65 it.rinfo()->wasm_memory_reference(), |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 ret_value = runnable.Call(); | 129 ret_value = runnable.Call(); |
| 130 CHECK_NE(ret_value, 0xdeadbeef); | 130 CHECK_NE(ret_value, 0xdeadbeef); |
| 131 | 131 |
| 132 #ifdef DEBUG | 132 #ifdef DEBUG |
| 133 code->Print(os); | 133 code->Print(os); |
| 134 ::printf("f() = %" PRIx64 "\n\n", ret_value); | 134 ::printf("f() = %" PRIx64 "\n\n", ret_value); |
| 135 #endif | 135 #endif |
| 136 } | 136 } |
| 137 | 137 |
| 138 #undef __ | 138 #undef __ |
| OLD | NEW |