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

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

Issue 2344143003: Moved zones and zone related stuff in its own directory. (Closed)
Patch Set: Merge branch 'master' into zonefolder 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-liveedit.cc ('k') | test/cctest/wasm/test-run-wasm-64.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 <stdint.h> 5 #include <stdint.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "src/base/platform/elapsed-timer.h" 9 #include "src/base/platform/elapsed-timer.h"
10 #include "src/utils.h" 10 #include "src/utils.h"
(...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after
2106 2106
2107 // 64-bit cases handled in test-run-wasm-64.cc. 2107 // 64-bit cases handled in test-run-wasm-64.cc.
2108 static MachineType mixed[] = { 2108 static MachineType mixed[] = {
2109 MachineType::Int32(), MachineType::Float32(), MachineType::Float64(), 2109 MachineType::Int32(), MachineType::Float32(), MachineType::Float64(),
2110 MachineType::Float32(), MachineType::Int32(), MachineType::Float64(), 2110 MachineType::Float32(), MachineType::Int32(), MachineType::Float64(),
2111 MachineType::Float32(), MachineType::Float64(), MachineType::Int32(), 2111 MachineType::Float32(), MachineType::Float64(), MachineType::Int32(),
2112 MachineType::Int32(), MachineType::Int32()}; 2112 MachineType::Int32(), MachineType::Int32()};
2113 2113
2114 int num_params = static_cast<int>(arraysize(mixed)) - start; 2114 int num_params = static_cast<int>(arraysize(mixed)) - start;
2115 for (int which = 0; which < num_params; ++which) { 2115 for (int which = 0; which < num_params; ++which) {
2116 v8::base::AccountingAllocator allocator; 2116 v8::internal::AccountingAllocator allocator;
2117 Zone zone(&allocator); 2117 Zone zone(&allocator);
2118 TestingModule module(execution_mode); 2118 TestingModule module(execution_mode);
2119 module.AddMemory(1024); 2119 module.AddMemory(1024);
2120 MachineType* memtypes = &mixed[start]; 2120 MachineType* memtypes = &mixed[start];
2121 MachineType result = memtypes[which]; 2121 MachineType result = memtypes[which];
2122 2122
2123 // ========================================================================= 2123 // =========================================================================
2124 // Build the selector function. 2124 // Build the selector function.
2125 // ========================================================================= 2125 // =========================================================================
2126 uint32_t index; 2126 uint32_t index;
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
2634 FOR_FLOAT32_INPUTS(i) { 2634 FOR_FLOAT32_INPUTS(i) {
2635 FOR_FLOAT32_INPUTS(j) { CHECK_FLOAT_EQ(copysignf(*i, *j), r.Call(*i, *j)); } 2635 FOR_FLOAT32_INPUTS(j) { CHECK_FLOAT_EQ(copysignf(*i, *j), r.Call(*i, *j)); }
2636 } 2636 }
2637 } 2637 }
2638 2638
2639 static void CompileCallIndirectMany(LocalType param) { 2639 static void CompileCallIndirectMany(LocalType param) {
2640 // Make sure we don't run out of registers when compiling indirect calls 2640 // Make sure we don't run out of registers when compiling indirect calls
2641 // with many many parameters. 2641 // with many many parameters.
2642 TestSignatures sigs; 2642 TestSignatures sigs;
2643 for (byte num_params = 0; num_params < 40; ++num_params) { 2643 for (byte num_params = 0; num_params < 40; ++num_params) {
2644 v8::base::AccountingAllocator allocator; 2644 v8::internal::AccountingAllocator allocator;
2645 Zone zone(&allocator); 2645 Zone zone(&allocator);
2646 HandleScope scope(CcTest::InitIsolateOnce()); 2646 HandleScope scope(CcTest::InitIsolateOnce());
2647 TestingModule module(kExecuteCompiled); 2647 TestingModule module(kExecuteCompiled);
2648 FunctionSig* sig = sigs.many(&zone, kAstStmt, param, num_params); 2648 FunctionSig* sig = sigs.many(&zone, kAstStmt, param, num_params);
2649 2649
2650 module.AddSignature(sig); 2650 module.AddSignature(sig);
2651 module.AddSignature(sig); 2651 module.AddSignature(sig);
2652 module.AddIndirectFunctionTable(nullptr, 0); 2652 module.AddIndirectFunctionTable(nullptr, 0);
2653 2653
2654 WasmFunctionCompiler t(sig, &module); 2654 WasmFunctionCompiler t(sig, &module);
(...skipping 21 matching lines...) Expand all
2676 MachineType::Int32()); 2676 MachineType::Int32());
2677 BUILD(r, WASM_I32_REMS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)), WASM_ZERO); 2677 BUILD(r, WASM_I32_REMS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)), WASM_ZERO);
2678 const int32_t kMin = std::numeric_limits<int32_t>::min(); 2678 const int32_t kMin = std::numeric_limits<int32_t>::min();
2679 CHECK_EQ(0, r.Call(133, 100)); 2679 CHECK_EQ(0, r.Call(133, 100));
2680 CHECK_EQ(0, r.Call(kMin, -1)); 2680 CHECK_EQ(0, r.Call(kMin, -1));
2681 CHECK_EQ(0, r.Call(0, 1)); 2681 CHECK_EQ(0, r.Call(0, 1));
2682 CHECK_TRAP(r.Call(100, 0)); 2682 CHECK_TRAP(r.Call(100, 0));
2683 CHECK_TRAP(r.Call(-1001, 0)); 2683 CHECK_TRAP(r.Call(-1001, 0));
2684 CHECK_TRAP(r.Call(kMin, 0)); 2684 CHECK_TRAP(r.Call(kMin, 0));
2685 } 2685 }
OLDNEW
« no previous file with comments | « test/cctest/test-liveedit.cc ('k') | test/cctest/wasm/test-run-wasm-64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698