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

Side by Side Diff: test/cctest/test-run-wasm-relocation-arm64.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
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/arm64/assembler-arm64-inl.h" 10 #include "src/arm64/assembler-arm64-inl.h"
(...skipping 23 matching lines...) Expand all
34 DummyStaticFunction(NULL); 34 DummyStaticFunction(NULL);
35 int64_t imm = 1234567; 35 int64_t imm = 1234567;
36 36
37 MacroAssembler masm(isolate, buffer, sizeof buffer, 37 MacroAssembler masm(isolate, buffer, sizeof buffer,
38 v8::internal::CodeObjectRequired::kYes); 38 v8::internal::CodeObjectRequired::kYes);
39 39
40 __ Mov(x0, Immediate(imm, RelocInfo::WASM_MEMORY_REFERENCE)); 40 __ Mov(x0, Immediate(imm, RelocInfo::WASM_MEMORY_REFERENCE));
41 __ Ret(); 41 __ Ret();
42 42
43 CodeDesc desc; 43 CodeDesc desc;
44 masm.GetCode(&desc); 44 masm.GetCode(isolate, &desc);
45 Handle<Code> code = isolate->factory()->NewCode( 45 Handle<Code> code = isolate->factory()->NewCode(
46 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 46 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
47 47
48 CSignature0<int64_t> csig; 48 CSignature0<int64_t> csig;
49 CodeRunner<int64_t> runnable(isolate, code, &csig); 49 CodeRunner<int64_t> runnable(isolate, code, &csig);
50 int64_t ret_value = runnable.Call(); 50 int64_t ret_value = runnable.Call();
51 CHECK_EQ(ret_value, imm); 51 CHECK_EQ(ret_value, imm);
52 52
53 #ifdef DEBUG 53 #ifdef DEBUG
54 OFStream os(stdout); 54 OFStream os(stdout);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 __ Mov(x0, size); 91 __ Mov(x0, size);
92 __ Cmp(x0, size); 92 __ Cmp(x0, size);
93 __ B(ne, &fail); 93 __ B(ne, &fail);
94 __ Ret(); 94 __ Ret();
95 __ Bind(&fail); 95 __ Bind(&fail);
96 __ Mov(x0, Immediate(0xdeadbeef)); 96 __ Mov(x0, Immediate(0xdeadbeef));
97 __ Ret(); 97 __ Ret();
98 98
99 CodeDesc desc; 99 CodeDesc desc;
100 masm.GetCode(&desc); 100 masm.GetCode(isolate, &desc);
101 Handle<Code> code = isolate->factory()->NewCode( 101 Handle<Code> code = isolate->factory()->NewCode(
102 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 102 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
103 103
104 CSignature0<int64_t> csig; 104 CSignature0<int64_t> csig;
105 CodeRunner<int64_t> runnable(isolate, code, &csig); 105 CodeRunner<int64_t> runnable(isolate, code, &csig);
106 int64_t ret_value = runnable.Call(); 106 int64_t ret_value = runnable.Call();
107 CHECK_NE(ret_value, 0xdeadbeef); 107 CHECK_NE(ret_value, 0xdeadbeef);
108 108
109 #ifdef DEBUG 109 #ifdef DEBUG
110 OFStream os(stdout); 110 OFStream os(stdout);
(...skipping 13 matching lines...) Expand all
124 ret_value = runnable.Call(); 124 ret_value = runnable.Call();
125 CHECK_NE(ret_value, 0xdeadbeef); 125 CHECK_NE(ret_value, 0xdeadbeef);
126 126
127 #ifdef DEBUG 127 #ifdef DEBUG
128 code->Print(os); 128 code->Print(os);
129 ::printf("f() = %" PRIx64 "\n\n", ret_value); 129 ::printf("f() = %" PRIx64 "\n\n", ret_value);
130 #endif 130 #endif
131 } 131 }
132 132
133 #undef __ 133 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-run-wasm-relocation-arm.cc ('k') | test/cctest/test-run-wasm-relocation-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698