Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: test/cctest/test-run-wasm-relocation-arm.cc

Issue 2900683002: [compiler] Delay allocation of code-embedded heap numbers. (Closed)
Patch Set: Fix rebase. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-macro-assembler-x64.cc ('k') | test/cctest/test-run-wasm-relocation-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/arm/assembler-arm-inl.h" 10 #include "src/arm/assembler-arm-inl.h"
(...skipping 18 matching lines...) Expand all
29 v8::internal::byte buffer[4096]; 29 v8::internal::byte buffer[4096];
30 DummyStaticFunction(NULL); 30 DummyStaticFunction(NULL);
31 int32_t imm = 1234567; 31 int32_t imm = 1234567;
32 32
33 Assembler assm(isolate, buffer, sizeof buffer); 33 Assembler assm(isolate, buffer, sizeof buffer);
34 34
35 __ mov(r0, Operand(imm, RelocInfo::WASM_MEMORY_REFERENCE)); 35 __ mov(r0, Operand(imm, RelocInfo::WASM_MEMORY_REFERENCE));
36 __ mov(pc, Operand(lr)); 36 __ mov(pc, Operand(lr));
37 37
38 CodeDesc desc; 38 CodeDesc desc;
39 assm.GetCode(&desc); 39 assm.GetCode(isolate, &desc);
40 Handle<Code> code = isolate->factory()->NewCode( 40 Handle<Code> code = isolate->factory()->NewCode(
41 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 41 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
42 42
43 CSignature0<int32_t> csig; 43 CSignature0<int32_t> csig;
44 CodeRunner<int32_t> runnable(isolate, code, &csig); 44 CodeRunner<int32_t> runnable(isolate, code, &csig);
45 int32_t ret_value = runnable.Call(); 45 int32_t ret_value = runnable.Call();
46 CHECK_EQ(ret_value, imm); 46 CHECK_EQ(ret_value, imm);
47 47
48 #ifdef DEBUG 48 #ifdef DEBUG
49 OFStream os(stdout); 49 OFStream os(stdout);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 __ mov(r0, Operand(size, RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); 85 __ mov(r0, Operand(size, RelocInfo::WASM_MEMORY_SIZE_REFERENCE));
86 __ cmp(r0, Operand(size, RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); 86 __ cmp(r0, Operand(size, RelocInfo::WASM_MEMORY_SIZE_REFERENCE));
87 __ b(ne, &fail); 87 __ b(ne, &fail);
88 __ mov(pc, Operand(lr)); 88 __ mov(pc, Operand(lr));
89 __ bind(&fail); 89 __ bind(&fail);
90 __ mov(r0, Operand(0xdeadbeef)); 90 __ mov(r0, Operand(0xdeadbeef));
91 __ mov(pc, Operand(lr)); 91 __ mov(pc, Operand(lr));
92 92
93 CodeDesc desc; 93 CodeDesc desc;
94 assm.GetCode(&desc); 94 assm.GetCode(isolate, &desc);
95 Handle<Code> code = isolate->factory()->NewCode( 95 Handle<Code> code = isolate->factory()->NewCode(
96 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 96 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
97 97
98 CSignature0<int32_t> csig; 98 CSignature0<int32_t> csig;
99 CodeRunner<int32_t> runnable(isolate, code, &csig); 99 CodeRunner<int32_t> runnable(isolate, code, &csig);
100 int32_t ret_value = runnable.Call(); 100 int32_t ret_value = runnable.Call();
101 CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef)); 101 CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef));
102 102
103 #ifdef DEBUG 103 #ifdef DEBUG
104 OFStream os(stdout); 104 OFStream os(stdout);
(...skipping 12 matching lines...) Expand all
117 117
118 ret_value = runnable.Call(); 118 ret_value = runnable.Call();
119 CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef)); 119 CHECK_NE(ret_value, bit_cast<int32_t>(0xdeadbeef));
120 120
121 #ifdef DEBUG 121 #ifdef DEBUG
122 code->Print(os); 122 code->Print(os);
123 ::printf("f() = %d\n\n", ret_value); 123 ::printf("f() = %d\n\n", ret_value);
124 #endif 124 #endif
125 } 125 }
126 #undef __ 126 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-macro-assembler-x64.cc ('k') | test/cctest/test-run-wasm-relocation-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698