summaryrefslogtreecommitdiff
path: root/deps/v8/src/asmjs
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-03-07 08:54:53 +0100
committerMichaël Zasso <targos@protonmail.com>2018-03-07 16:48:52 +0100
commit88786fecff336342a56e6f2e7ff3b286be716e47 (patch)
tree92e6ba5b8ac8dae1a058988d20c9d27bfa654390 /deps/v8/src/asmjs
parent4e86f9b5ab83cbabf43839385bf383e6a7ef7d19 (diff)
downloadandroid-node-v8-88786fecff336342a56e6f2e7ff3b286be716e47.tar.gz
android-node-v8-88786fecff336342a56e6f2e7ff3b286be716e47.tar.bz2
android-node-v8-88786fecff336342a56e6f2e7ff3b286be716e47.zip
deps: update V8 to 6.5.254.31
PR-URL: https://github.com/nodejs/node/pull/18453 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/v8/src/asmjs')
-rw-r--r--deps/v8/src/asmjs/asm-parser.cc36
-rw-r--r--deps/v8/src/asmjs/asm-scanner.cc2
2 files changed, 18 insertions, 20 deletions
diff --git a/deps/v8/src/asmjs/asm-parser.cc b/deps/v8/src/asmjs/asm-parser.cc
index c38c52220d..6be80bf7af 100644
--- a/deps/v8/src/asmjs/asm-parser.cc
+++ b/deps/v8/src/asmjs/asm-parser.cc
@@ -292,8 +292,7 @@ void AsmJsParser::Begin(AsmJsScanner::token_t label) {
void AsmJsParser::Loop(AsmJsScanner::token_t label) {
BareBegin(BlockKind::kLoop, label);
- int position = static_cast<int>(scanner_.Position());
- DCHECK_EQ(position, scanner_.Position());
+ size_t position = scanner_.Position();
current_function_builder_->AddAsmWasmOffset(position, position);
current_function_builder_->EmitWithU8(kExprLoop, kLocalVoid);
}
@@ -450,7 +449,7 @@ void AsmJsParser::ValidateModuleVar(bool mutable_variable) {
DeclareGlobal(info, mutable_variable, AsmType::Double(), kWasmF64,
WasmInitExpr(dvalue));
} else if (CheckForUnsigned(&uvalue)) {
- if (uvalue > 0x7fffffff) {
+ if (uvalue > 0x7FFFFFFF) {
FAIL("Numeric literal out of range");
}
DeclareGlobal(info, mutable_variable,
@@ -461,7 +460,7 @@ void AsmJsParser::ValidateModuleVar(bool mutable_variable) {
DeclareGlobal(info, mutable_variable, AsmType::Double(), kWasmF64,
WasmInitExpr(-dvalue));
} else if (CheckForUnsigned(&uvalue)) {
- if (uvalue > 0x7fffffff) {
+ if (uvalue > 0x7FFFFFFF) {
FAIL("Numeric literal out of range");
}
DeclareGlobal(info, mutable_variable,
@@ -742,8 +741,7 @@ void AsmJsParser::ValidateFunction() {
return_type_ = nullptr;
// Record start of the function, used as position for the stack check.
- int start_position = static_cast<int>(scanner_.Position());
- current_function_builder_->SetAsmFunctionStartPosition(start_position);
+ current_function_builder_->SetAsmFunctionStartPosition(scanner_.Position());
CachedVector<AsmType*> params(cached_asm_type_p_vectors_);
ValidateFunctionParams(&params);
@@ -902,7 +900,7 @@ void AsmJsParser::ValidateFunctionLocals(size_t param_count,
current_function_builder_->EmitF64Const(-dvalue);
current_function_builder_->EmitSetLocal(info->index);
} else if (CheckForUnsigned(&uvalue)) {
- if (uvalue > 0x7fffffff) {
+ if (uvalue > 0x7FFFFFFF) {
FAIL("Numeric literal out of range");
}
info->kind = VarKind::kLocal;
@@ -954,7 +952,7 @@ void AsmJsParser::ValidateFunctionLocals(size_t param_count,
current_function_builder_->EmitF32Const(dvalue);
current_function_builder_->EmitSetLocal(info->index);
} else if (CheckForUnsigned(&uvalue)) {
- if (uvalue > 0x7fffffff) {
+ if (uvalue > 0x7FFFFFFF) {
FAIL("Numeric literal out of range");
}
info->kind = VarKind::kLocal;
@@ -1337,7 +1335,7 @@ void AsmJsParser::ValidateCase() {
FAIL("Expected numeric literal");
}
// TODO(bradnelson): Share negation plumbing.
- if ((negate && uvalue > 0x80000000) || (!negate && uvalue > 0x7fffffff)) {
+ if ((negate && uvalue > 0x80000000) || (!negate && uvalue > 0x7FFFFFFF)) {
FAIL("Numeric literal out of range");
}
int32_t value = static_cast<int32_t>(uvalue);
@@ -1398,11 +1396,11 @@ AsmType* AsmJsParser::NumericLiteral() {
current_function_builder_->EmitF64Const(dvalue);
return AsmType::Double();
} else if (CheckForUnsigned(&uvalue)) {
- if (uvalue <= 0x7fffffff) {
+ if (uvalue <= 0x7FFFFFFF) {
current_function_builder_->EmitI32Const(static_cast<int32_t>(uvalue));
return AsmType::FixNum();
} else {
- DCHECK_LE(uvalue, 0xffffffff);
+ DCHECK_LE(uvalue, 0xFFFFFFFF);
current_function_builder_->EmitI32Const(static_cast<int32_t>(uvalue));
return AsmType::Unsigned();
}
@@ -1553,7 +1551,7 @@ AsmType* AsmJsParser::UnaryExpression() {
if (Check('-')) {
uint32_t uvalue;
if (CheckForUnsigned(&uvalue)) {
- // TODO(bradnelson): was supposed to be 0x7fffffff, check errata.
+ // TODO(bradnelson): was supposed to be 0x7FFFFFFF, check errata.
if (uvalue <= 0x80000000) {
current_function_builder_->EmitI32Const(-static_cast<int32_t>(uvalue));
} else {
@@ -1621,7 +1619,7 @@ AsmType* AsmJsParser::UnaryExpression() {
if (!ret->IsA(AsmType::Intish())) {
FAILn("operator ~ expects intish");
}
- current_function_builder_->EmitI32Const(0xffffffff);
+ current_function_builder_->EmitI32Const(0xFFFFFFFF);
current_function_builder_->Emit(kExprI32Xor);
ret = AsmType::Signed();
}
@@ -2066,8 +2064,8 @@ AsmType* AsmJsParser::ParenthesizedExpression() {
AsmType* AsmJsParser::ValidateCall() {
AsmType* return_type = call_coercion_;
call_coercion_ = nullptr;
- int call_pos = static_cast<int>(scanner_.Position());
- int to_number_pos = static_cast<int>(call_coercion_position_);
+ size_t call_pos = scanner_.Position();
+ size_t to_number_pos = call_coercion_position_;
bool allow_peek = (call_coercion_deferred_position_ == scanner_.Position());
AsmJsScanner::token_t function_name = Consume();
@@ -2113,7 +2111,7 @@ AsmType* AsmJsParser::ValidateCall() {
tmp.emplace(this);
current_function_builder_->EmitSetLocal(tmp->get());
// The position of function table calls is after the table lookup.
- call_pos = static_cast<int>(scanner_.Position());
+ call_pos = scanner_.Position();
} else {
VarInfo* function_info = GetVarInfo(function_name);
if (function_info->kind == VarKind::kUnused) {
@@ -2176,7 +2174,7 @@ AsmType* AsmJsParser::ValidateCall() {
(return_type == nullptr || return_type->IsA(AsmType::Float()))) {
DCHECK_NULL(call_coercion_deferred_);
call_coercion_deferred_ = AsmType::Signed();
- to_number_pos = static_cast<int>(scanner_.Position());
+ to_number_pos = scanner_.Position();
return_type = AsmType::Signed();
} else if (return_type == nullptr) {
to_number_pos = call_pos; // No conversion.
@@ -2395,9 +2393,9 @@ void AsmJsParser::ValidateHeapAccess() {
// TODO(bradnelson): Check more things.
// TODO(mstarzinger): Clarify and explain where this limit is coming from,
// as it is not mandated by the spec directly.
- if (offset > 0x7fffffff ||
+ if (offset > 0x7FFFFFFF ||
static_cast<uint64_t>(offset) * static_cast<uint64_t>(size) >
- 0x7fffffff) {
+ 0x7FFFFFFF) {
FAIL("Heap access out of range");
}
if (Check(']')) {
diff --git a/deps/v8/src/asmjs/asm-scanner.cc b/deps/v8/src/asmjs/asm-scanner.cc
index 910fe37546..af41208ead 100644
--- a/deps/v8/src/asmjs/asm-scanner.cc
+++ b/deps/v8/src/asmjs/asm-scanner.cc
@@ -15,7 +15,7 @@ namespace internal {
namespace {
// Cap number of identifiers to ensure we can assign both global and
// local ones a token id in the range of an int32_t.
-static const int kMaxIdentifierCount = 0xf000000;
+static const int kMaxIdentifierCount = 0xF000000;
};
AsmJsScanner::AsmJsScanner(Utf16CharacterStream* stream)