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

Unified Diff: test/cctest/wasm/test-run-wasm-module.cc

Issue 2277443009: Populate relocation information correctly for RelocatableInt32Constants. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase + fix serializer test flakiness Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | test/mjsunit/wasm/grow-memory.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm-module.cc
diff --git a/test/cctest/wasm/test-run-wasm-module.cc b/test/cctest/wasm/test-run-wasm-module.cc
index added4fd92113b1bd367f54b53e80d09c53f4707..3ca75550edbf112911006b2885893d2ad2ea310f 100644
--- a/test/cctest/wasm/test-run-wasm-module.cc
+++ b/test/cctest/wasm/test-run-wasm-module.cc
@@ -200,9 +200,17 @@ TEST(Run_WasmModule_Serialization) {
ZoneBuffer buffer(&zone);
builder->WriteTo(buffer);
- Isolate* isolate = CcTest::InitIsolateOnce();
- ErrorThrower thrower(isolate, "");
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator =
+ CcTest::InitIsolateOnce()->array_buffer_allocator();
+
+ v8::Isolate* v8_isolate = v8::Isolate::New(create_params);
+ Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate);
+ v8::HandleScope new_scope(v8_isolate);
+ v8::Local<v8::Context> new_ctx = v8::Context::New(v8_isolate);
+ new_ctx->Enter();
+ ErrorThrower thrower(isolate, "");
v8::WasmCompiledModule::SerializedModule data;
{
HandleScope scope(isolate);
@@ -225,10 +233,8 @@ TEST(Run_WasmModule_Serialization) {
data = v8_compiled_module->Serialize();
}
- v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = isolate->array_buffer_allocator();
- v8::Isolate* v8_isolate = v8::Isolate::New(create_params);
isolate = reinterpret_cast<Isolate*>(v8_isolate);
{
v8::Isolate::Scope isolate_scope(v8_isolate);
@@ -257,6 +263,24 @@ TEST(Run_WasmModule_Serialization) {
}
}
+TEST(Run_WasmModule_MemSize_GrowMem) {
+ static const int kPageSize = 0x10000;
+ // Initial memory size = 16 + GrowMemory(10)
+ static const int kExpectedValue = kPageSize * 26;
+ TestSignatures sigs;
+ v8::base::AccountingAllocator allocator;
+ Zone zone(&allocator);
+
+ WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
+ uint16_t f_index = builder->AddFunction();
+ WasmFunctionBuilder* f = builder->FunctionAt(f_index);
+ f->SetSignature(sigs.i_v());
+ ExportAsMain(f);
+ byte code[] = {WASM_GROW_MEMORY(WASM_I8(10)), WASM_MEMORY_SIZE};
+ f->EmitCode(code, sizeof(code));
+ TestModule(&zone, builder, kExpectedValue);
+}
+
TEST(Run_WasmModule_GrowMemoryInIf) {
TestSignatures sigs;
v8::base::AccountingAllocator allocator;
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | test/mjsunit/wasm/grow-memory.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698