aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/asmjs
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/asmjs')
-rw-r--r--deps/v8/src/asmjs/OWNERS2
-rw-r--r--deps/v8/src/asmjs/asm-js.cc12
-rw-r--r--deps/v8/src/asmjs/asm-js.h2
-rw-r--r--deps/v8/src/asmjs/asm-parser.cc26
-rw-r--r--deps/v8/src/asmjs/asm-parser.h6
5 files changed, 26 insertions, 22 deletions
diff --git a/deps/v8/src/asmjs/OWNERS b/deps/v8/src/asmjs/OWNERS
index d4103ae0c1..08f39f8d6a 100644
--- a/deps/v8/src/asmjs/OWNERS
+++ b/deps/v8/src/asmjs/OWNERS
@@ -1,5 +1,3 @@
-set noparent
-
ahaas@chromium.org
clemensh@chromium.org
mstarzinger@chromium.org
diff --git a/deps/v8/src/asmjs/asm-js.cc b/deps/v8/src/asmjs/asm-js.cc
index 5a38eeef36..7433b6a12c 100644
--- a/deps/v8/src/asmjs/asm-js.cc
+++ b/deps/v8/src/asmjs/asm-js.cc
@@ -12,9 +12,9 @@
#include "src/codegen/compiler.h"
#include "src/codegen/unoptimized-compilation-info.h"
#include "src/common/assert-scope.h"
+#include "src/common/message-template.h"
#include "src/execution/execution.h"
#include "src/execution/isolate.h"
-#include "src/execution/message-template.h"
#include "src/handles/handles.h"
#include "src/heap/factory.h"
#include "src/logging/counters.h"
@@ -249,9 +249,9 @@ UnoptimizedCompilationJob::Status AsmJsCompilationJob::ExecuteJobImpl() {
return FAILED;
}
module_ = new (compile_zone) wasm::ZoneBuffer(compile_zone);
- parser.module_builder()->WriteTo(*module_);
+ parser.module_builder()->WriteTo(module_);
asm_offsets_ = new (compile_zone) wasm::ZoneBuffer(compile_zone);
- parser.module_builder()->WriteAsmJsOffsetTable(*asm_offsets_);
+ parser.module_builder()->WriteAsmJsOffsetTable(asm_offsets_);
stdlib_uses_ = *parser.stdlib_uses();
size_t compile_zone_size =
@@ -287,7 +287,7 @@ UnoptimizedCompilationJob::Status AsmJsCompilationJob::FinalizeJobImpl(
isolate, &thrower,
wasm::ModuleWireBytes(module_->begin(), module_->end()),
Vector<const byte>(asm_offsets_->begin(), asm_offsets_->size()),
- uses_bitset)
+ uses_bitset, shared_info->language_mode())
.ToHandleChecked();
DCHECK(!thrower.error());
compile_time_ = compile_timer.Elapsed().InMillisecondsF();
@@ -319,10 +319,10 @@ void AsmJsCompilationJob::RecordHistograms(Isolate* isolate) {
translation_throughput);
}
-UnoptimizedCompilationJob* AsmJs::NewCompilationJob(
+std::unique_ptr<UnoptimizedCompilationJob> AsmJs::NewCompilationJob(
ParseInfo* parse_info, FunctionLiteral* literal,
AccountingAllocator* allocator) {
- return new AsmJsCompilationJob(parse_info, literal, allocator);
+ return base::make_unique<AsmJsCompilationJob>(parse_info, literal, allocator);
}
namespace {
diff --git a/deps/v8/src/asmjs/asm-js.h b/deps/v8/src/asmjs/asm-js.h
index 46dd3f2e34..3e714cba7a 100644
--- a/deps/v8/src/asmjs/asm-js.h
+++ b/deps/v8/src/asmjs/asm-js.h
@@ -23,7 +23,7 @@ class UnoptimizedCompilationJob;
// Interface to compile and instantiate for asm.js modules.
class AsmJs {
public:
- static UnoptimizedCompilationJob* NewCompilationJob(
+ static std::unique_ptr<UnoptimizedCompilationJob> NewCompilationJob(
ParseInfo* parse_info, FunctionLiteral* literal,
AccountingAllocator* allocator);
static MaybeHandle<Object> InstantiateAsmWasm(Isolate* isolate,
diff --git a/deps/v8/src/asmjs/asm-parser.cc b/deps/v8/src/asmjs/asm-parser.cc
index 3d290a1fe1..6ac39dc89c 100644
--- a/deps/v8/src/asmjs/asm-parser.cc
+++ b/deps/v8/src/asmjs/asm-parser.cc
@@ -253,7 +253,7 @@ void AsmJsParser::DeclareGlobal(VarInfo* info, bool mutable_variable,
const WasmInitExpr& init) {
info->kind = VarKind::kGlobal;
info->type = type;
- info->index = module_builder_->AddGlobal(vtype, false, true, init);
+ info->index = module_builder_->AddGlobal(vtype, true, init);
info->mutable_variable = mutable_variable;
}
@@ -385,7 +385,8 @@ void AsmJsParser::ValidateModule() {
module_builder_->MarkStartFunction(start);
for (auto& global_import : global_imports_) {
uint32_t import_index = module_builder_->AddGlobalImport(
- global_import.import_name, global_import.value_type);
+ global_import.import_name, global_import.value_type,
+ false /* mutability */);
start->EmitWithI32V(kExprGetGlobal, import_index);
start->EmitWithI32V(kExprSetGlobal, VarIndex(global_import.var_info));
}
@@ -754,7 +755,7 @@ void AsmJsParser::ValidateFunction() {
// Record start of the function, used as position for the stack check.
current_function_builder_->SetAsmFunctionStartPosition(scanner_.Position());
- CachedVector<AsmType*> params(cached_asm_type_p_vectors_);
+ CachedVector<AsmType*> params(&cached_asm_type_p_vectors_);
ValidateFunctionParams(&params);
// Check against limit on number of parameters.
@@ -762,7 +763,7 @@ void AsmJsParser::ValidateFunction() {
FAIL("Number of parameters exceeds internal limit");
}
- CachedVector<ValueType> locals(cached_valuetype_vectors_);
+ CachedVector<ValueType> locals(&cached_valuetype_vectors_);
ValidateFunctionLocals(params.size(), &locals);
function_temp_locals_offset_ = static_cast<uint32_t>(
@@ -837,7 +838,7 @@ void AsmJsParser::ValidateFunctionParams(ZoneVector<AsmType*>* params) {
scanner_.EnterLocalScope();
EXPECT_TOKEN('(');
CachedVector<AsmJsScanner::token_t> function_parameters(
- cached_token_t_vectors_);
+ &cached_token_t_vectors_);
while (!failed_ && !Peek(')')) {
if (!scanner_.IsLocal()) {
FAIL("Expected parameter name");
@@ -969,7 +970,8 @@ void AsmJsParser::ValidateFunctionLocals(size_t param_count,
if (negate) {
dvalue = -dvalue;
}
- current_function_builder_->EmitF32Const(dvalue);
+ float fvalue = DoubleToFloat32(dvalue);
+ current_function_builder_->EmitF32Const(fvalue);
current_function_builder_->EmitSetLocal(info->index);
} else if (CheckForUnsigned(&uvalue)) {
if (uvalue > 0x7FFFFFFF) {
@@ -1314,7 +1316,7 @@ void AsmJsParser::SwitchStatement() {
Begin(pending_label_);
pending_label_ = 0;
// TODO(bradnelson): Make less weird.
- CachedVector<int32_t> cases(cached_int_vectors_);
+ CachedVector<int32_t> cases(&cached_int_vectors_);
GatherCases(&cases);
EXPECT_TOKEN('{');
size_t count = cases.size() + 1;
@@ -2108,7 +2110,11 @@ AsmType* AsmJsParser::ValidateCall() {
// need to match the information stored at this point.
base::Optional<TemporaryVariableScope> tmp;
if (Check('[')) {
- RECURSEn(EqualityExpression());
+ AsmType* index = nullptr;
+ RECURSEn(index = EqualityExpression());
+ if (!index->IsA(AsmType::Intish())) {
+ FAILn("Expected intish index");
+ }
EXPECT_TOKENn('&');
uint32_t mask = 0;
if (!CheckForUnsigned(&mask)) {
@@ -2161,8 +2167,8 @@ AsmType* AsmJsParser::ValidateCall() {
}
// Parse argument list and gather types.
- CachedVector<AsmType*> param_types(cached_asm_type_p_vectors_);
- CachedVector<AsmType*> param_specific_types(cached_asm_type_p_vectors_);
+ CachedVector<AsmType*> param_types(&cached_asm_type_p_vectors_);
+ CachedVector<AsmType*> param_specific_types(&cached_asm_type_p_vectors_);
EXPECT_TOKENn('(');
while (!failed_ && !Peek(')')) {
AsmType* t;
diff --git a/deps/v8/src/asmjs/asm-parser.h b/deps/v8/src/asmjs/asm-parser.h
index 8740cdad11..c7bf30c29e 100644
--- a/deps/v8/src/asmjs/asm-parser.h
+++ b/deps/v8/src/asmjs/asm-parser.h
@@ -154,9 +154,9 @@ class AsmJsParser {
template <typename T>
class CachedVector final : public ZoneVector<T> {
public:
- explicit CachedVector(CachedVectors<T>& cache)
- : ZoneVector<T>(cache.zone()), cache_(&cache) {
- cache.fill(this);
+ explicit CachedVector(CachedVectors<T>* cache)
+ : ZoneVector<T>(cache->zone()), cache_(cache) {
+ cache->fill(this);
}
~CachedVector() { cache_->reuse(this); }