3f9ff062b0
This is a reland of 80f5dfda01
. A condition
in pipeline.cc was inverted, which lead to a CSA verifier error.
Original change's description:
> [no-wasm] Exclude src/wasm from compilation
>
> This is the biggest chunk, including
> - all of src/wasm,
> - torque file for wasm objects,
> - torque file for wasm builtins,
> - wasm builtins,
> - wasm runtime functions,
> - int64 lowering,
> - simd scala lowering,
> - WasmGraphBuilder (TF graph construction for wasm),
> - wasm frame types,
> - wasm interrupts,
> - the JSWasmCall opcode,
> - wasm backing store allocation.
>
> Those components are all recursively entangled, so I found no way to
> split this change up further.
>
> Some includes that were recursively included by wasm headers needed to
> be added explicitly now.
>
> backing-store-unittest.cc is renamed to wasm-backing-store-unittest.cc
> because it only tests wasm backing stores. This file is excluded from
> no-wasm builds then.
>
> R=jkummerow@chromium.org, jgruber@chromium.org, mlippautz@chromium.org, petermarshall@chromium.org
>
> Bug: v8:11238
> Change-Id: I7558f2d12d2dd6c65128c4de7b79173668c80b2b
> Cq-Include-Trybots: luci.v8.try:v8_linux64_no_wasm_compile_rel
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2742955
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#73344}
TBR=jgruber@chromium.org
Bug: v8:11238
Change-Id: I20bd2847a59c68738b5a336cd42582b7b1499585
Cq-Include-Trybots: luci.v8.try:v8_linux64_no_wasm_compile_rel
Cq-Include-Trybots: luci.v8.try:v8_linux_verify_csa_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_verify_csa_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2752867
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73348}
78 lines
2.1 KiB
C++
78 lines
2.1 KiB
C++
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "src/numbers/conversions.h"
|
|
|
|
#include "src/codegen/source-position.h"
|
|
#include "src/init/v8.h"
|
|
#include "test/unittests/test-utils.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
namespace interpreter {
|
|
|
|
class ConversionsTest : public ::testing::Test {
|
|
public:
|
|
ConversionsTest() = default;
|
|
~ConversionsTest() override = default;
|
|
|
|
SourcePosition toPos(int offset) {
|
|
return SourcePosition(offset, offset % 10 - 1);
|
|
}
|
|
};
|
|
|
|
// Some random offsets, mostly at 'suspicious' bit boundaries.
|
|
|
|
struct IntStringPair {
|
|
int integer;
|
|
std::string string;
|
|
};
|
|
|
|
static IntStringPair int_pairs[] = {{0, "0"},
|
|
{101, "101"},
|
|
{-1, "-1"},
|
|
{1024, "1024"},
|
|
{200000, "200000"},
|
|
{-1024, "-1024"},
|
|
{-200000, "-200000"},
|
|
{kMinInt, "-2147483648"},
|
|
{kMaxInt, "2147483647"}};
|
|
|
|
TEST_F(ConversionsTest, IntToCString) {
|
|
std::unique_ptr<char[]> buf(new char[4096]);
|
|
|
|
for (size_t i = 0; i < arraysize(int_pairs); i++) {
|
|
ASSERT_STREQ(IntToCString(int_pairs[i].integer, {buf.get(), 4096}),
|
|
int_pairs[i].string.c_str());
|
|
}
|
|
}
|
|
|
|
struct DoubleStringPair {
|
|
double number;
|
|
std::string string;
|
|
};
|
|
|
|
static DoubleStringPair double_pairs[] = {
|
|
{0.0, "0"},
|
|
{kMinInt, "-2147483648"},
|
|
{kMaxInt, "2147483647"},
|
|
// ES section 7.1.12.1 #sec-tostring-applied-to-the-number-type:
|
|
// -0.0 is stringified to "0".
|
|
{-0.0, "0"},
|
|
{1.1, "1.1"},
|
|
{0.1, "0.1"}};
|
|
|
|
TEST_F(ConversionsTest, DoubleToCString) {
|
|
std::unique_ptr<char[]> buf(new char[4096]);
|
|
|
|
for (size_t i = 0; i < arraysize(double_pairs); i++) {
|
|
ASSERT_STREQ(DoubleToCString(double_pairs[i].number, {buf.get(), 4096}),
|
|
double_pairs[i].string.c_str());
|
|
}
|
|
}
|
|
|
|
} // namespace interpreter
|
|
} // namespace internal
|
|
} // namespace v8
|