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

Unified Diff: src/asmjs/asm-wasm-builder.cc

Issue 2563613003: Revert of [wasm] Fix location for error in asm.js ToNumber conversion (Closed)
Patch Set: Created 4 years 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 | « no previous file | src/compiler/pipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-wasm-builder.cc
diff --git a/src/asmjs/asm-wasm-builder.cc b/src/asmjs/asm-wasm-builder.cc
index f928ae1b97e4bcdbe9e9785f16a181d0a281e50f..9415a84521e2c276ff8dc319fd46fab9ff2da274 100644
--- a/src/asmjs/asm-wasm-builder.cc
+++ b/src/asmjs/asm-wasm-builder.cc
@@ -71,8 +71,7 @@
foreign_init_function_(nullptr),
function_tables_(ZoneHashMap::kDefaultHashMapCapacity,
ZoneAllocationPolicy(zone)),
- imported_function_table_(this),
- parent_binop_(nullptr) {
+ imported_function_table_(this) {
InitializeAstVisitor(isolate);
}
@@ -1399,10 +1398,6 @@
bool VisitCallExpression(Call* expr) {
Call::CallType call_type = expr->GetCallType();
bool returns_value = true;
-
- // Save the parent now, it might be overwritten in VisitCallArgs.
- BinaryOperation* parent_binop = parent_binop_;
-
switch (call_type) {
case Call::OTHER_CALL: {
VariableProxy* proxy = expr->expression()->AsVariableProxy();
@@ -1433,20 +1428,13 @@
uint32_t index = imported_function_table_.LookupOrInsertImportUse(
vp->var(), sig.Build());
VisitCallArgs(expr);
- // For non-void functions, we must know the parent node.
- DCHECK_IMPLIES(returns_value, parent_binop != nullptr);
- DCHECK_IMPLIES(returns_value, parent_binop->left() == expr ||
- parent_binop->right() == expr);
- int pos = expr->position();
- int parent_pos = returns_value ? parent_binop->position() : pos;
- current_function_builder_->AddAsmWasmOffset(pos, parent_pos);
+ current_function_builder_->AddAsmWasmOffset(expr->position());
current_function_builder_->Emit(kExprCallFunction);
current_function_builder_->EmitVarInt(index);
} else {
WasmFunctionBuilder* function = LookupOrInsertFunction(vp->var());
VisitCallArgs(expr);
- current_function_builder_->AddAsmWasmOffset(expr->position(),
- expr->position());
+ current_function_builder_->AddAsmWasmOffset(expr->position());
current_function_builder_->Emit(kExprCallFunction);
current_function_builder_->EmitDirectCallIndex(
function->func_index());
@@ -1472,8 +1460,7 @@
VisitCallArgs(expr);
current_function_builder_->EmitGetLocal(tmp.index());
- current_function_builder_->AddAsmWasmOffset(expr->position(),
- expr->position());
+ current_function_builder_->AddAsmWasmOffset(expr->position());
current_function_builder_->Emit(kExprCallIndirect);
current_function_builder_->EmitVarInt(indices->signature_index);
current_function_builder_->EmitVarInt(0); // table index
@@ -1645,7 +1632,6 @@
void VisitBinaryOperation(BinaryOperation* expr) {
ConvertOperation convertOperation = MatchBinaryOperation(expr);
static const bool kDontIgnoreSign = false;
- parent_binop_ = expr;
if (convertOperation == kToDouble) {
RECURSE(Visit(expr->left()));
TypeIndex type = TypeIndexOf(expr->left(), kDontIgnoreSign);
@@ -1949,9 +1935,6 @@
uint32_t next_table_index_;
ZoneHashMap function_tables_;
ImportedFunctionTable imported_function_table_;
- // Remember the parent node for reporting the correct location for ToNumber
- // conversions after calls.
- BinaryOperation* parent_binop_;
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
« no previous file with comments | « no previous file | src/compiler/pipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698