| Index: src/mips64/full-codegen-mips64.cc
|
| diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc
|
| index adb74c62a4258bcd463ef9bbd6293dc93ad62298..8721f47b7877e6366503139b83d000932e936d76 100644
|
| --- a/src/mips64/full-codegen-mips64.cc
|
| +++ b/src/mips64/full-codegen-mips64.cc
|
| @@ -495,6 +495,7 @@ void FullCodeGenerator::EmitReturnSequence() {
|
| Label check_exit_codesize;
|
| masm_->bind(&check_exit_codesize);
|
| #endif
|
| +
|
| // Make sure that the constant pool is not emitted inside of the return
|
| // sequence.
|
| { Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
|
| @@ -502,7 +503,7 @@ void FullCodeGenerator::EmitReturnSequence() {
|
| // tool from instrumenting as we rely on the code size here.
|
| int32_t arg_count = info_->scope()->num_parameters() + 1;
|
| int32_t sp_delta = arg_count * kPointerSize;
|
| - CodeGenerator::RecordPositions(masm_, function()->end_position() - 1);
|
| + SetReturnPosition(function());
|
| __ RecordJSReturn();
|
| masm_->mov(sp, fp);
|
| int no_frame_start = masm_->pc_offset();
|
| @@ -1078,7 +1079,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
| }
|
|
|
| // Record position before stub call for type feedback.
|
| - SetSourcePosition(clause->position());
|
| + SetExpressionPosition(clause);
|
| Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT,
|
| strength(language_mode())).code();
|
| CallIC(ic, clause->CompareId());
|
| @@ -1124,8 +1125,9 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
|
|
| void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| Comment cmnt(masm_, "[ ForInStatement");
|
| + SetStatementPosition(stmt, SKIP_BREAK);
|
| +
|
| FeedbackVectorSlot slot = stmt->ForInFeedbackSlot();
|
| - SetStatementPosition(stmt);
|
|
|
| Label loop, exit;
|
| ForIn loop_statement(this, stmt);
|
| @@ -1133,7 +1135,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
|
|
| // Get the object to enumerate over. If the object is null or undefined, skip
|
| // over the loop. See ECMA-262 version 5, section 12.6.4.
|
| - SetExpressionPosition(stmt->enumerable());
|
| + SetExpressionAsStatementPosition(stmt->enumerable());
|
| VisitForAccumulatorValue(stmt->enumerable());
|
| __ mov(a0, result_register()); // Result as param to InvokeBuiltin below.
|
| __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
|
| @@ -1233,7 +1235,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| // Generate code for doing the condition check.
|
| PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
|
| __ bind(&loop);
|
| - SetExpressionPosition(stmt->each());
|
| + SetExpressionAsStatementPosition(stmt->each());
|
|
|
| // Load the current count to a0, load the length to a1.
|
| __ ld(a0, MemOperand(sp, 0 * kPointerSize));
|
| @@ -1479,7 +1481,7 @@ void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy,
|
|
|
| void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
|
| // Record position before possible IC call.
|
| - SetSourcePosition(proxy->position());
|
| + SetExpressionPosition(proxy);
|
| PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS);
|
| Variable* var = proxy->var();
|
|
|
| @@ -1978,6 +1980,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
|
| DCHECK(expr->target()->IsValidReferenceExpression());
|
|
|
| Comment cmnt(masm_, "[ Assignment");
|
| + SetExpressionPosition(expr, INSERT_BREAK);
|
|
|
| Property* property = expr->target()->AsProperty();
|
| LhsKind assign_type = Property::GetAssignType(property);
|
| @@ -2071,7 +2074,6 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
|
| __ push(v0); // Left operand goes on the stack.
|
| VisitForAccumulatorValue(expr->value());
|
|
|
| - SetSourcePosition(expr->position() + 1);
|
| AccumulatorValueContext context(this);
|
| if (ShouldInlineSmiCase(op)) {
|
| EmitInlineSmiBinaryOp(expr->binary_operation(),
|
| @@ -2088,8 +2090,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
|
| VisitForAccumulatorValue(expr->value());
|
| }
|
|
|
| - // Record source position before possible IC call.
|
| - SetSourcePosition(expr->position());
|
| + SetExpressionPosition(expr);
|
|
|
| // Store the value.
|
| switch (assign_type) {
|
| @@ -2119,6 +2120,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
|
|
|
| void FullCodeGenerator::VisitYield(Yield* expr) {
|
| Comment cmnt(masm_, "[ Yield");
|
| + SetExpressionPosition(expr);
|
| +
|
| // Evaluate yielded value first; the initial iterator definition depends on
|
| // this. It stays on the stack while we update the iterator.
|
| VisitForStackValue(expr->expression());
|
| @@ -2406,7 +2409,7 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
|
|
|
|
| void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
|
| - SetSourcePosition(prop->position());
|
| + SetExpressionPosition(prop);
|
| Literal* key = prop->key()->AsLiteral();
|
| DCHECK(!prop->IsSuperAccess());
|
|
|
| @@ -2419,7 +2422,8 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
|
|
|
| void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
|
| // Stack: receiver, home_object.
|
| - SetSourcePosition(prop->position());
|
| + SetExpressionPosition(prop);
|
| +
|
| Literal* key = prop->key()->AsLiteral();
|
| DCHECK(!key->value()->IsSmi());
|
| DCHECK(prop->IsSuperAccess());
|
| @@ -2431,8 +2435,9 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
|
|
|
|
|
| void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
|
| - SetSourcePosition(prop->position());
|
| // Call keyed load IC. It has register arguments receiver and key.
|
| + SetExpressionPosition(prop);
|
| +
|
| Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
|
| __ li(LoadDescriptor::SlotRegister(),
|
| Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
|
| @@ -2442,9 +2447,8 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
|
|
|
| void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
|
| // Stack: receiver, home_object, key.
|
| + SetExpressionPosition(prop);
|
| __ Push(Smi::FromInt(language_mode()));
|
| - SetSourcePosition(prop->position());
|
| -
|
| __ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
|
| }
|
|
|
| @@ -2814,12 +2818,11 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
|
|
|
| void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
|
| // Assignment to a property, using a named store IC.
|
| + SetExpressionPosition(expr);
|
| Property* prop = expr->target()->AsProperty();
|
| DCHECK(prop != NULL);
|
| DCHECK(prop->key()->IsLiteral());
|
|
|
| - // Record source code position before IC call.
|
| - SetSourcePosition(expr->position());
|
| __ mov(StoreDescriptor::ValueRegister(), result_register());
|
| __ li(StoreDescriptor::NameRegister(),
|
| Operand(prop->key()->AsLiteral()->value()));
|
| @@ -2868,9 +2871,8 @@ void FullCodeGenerator::EmitKeyedSuperPropertyStore(Property* prop) {
|
|
|
| void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
|
| // Assignment to a property, using a keyed store IC.
|
| + SetExpressionPosition(expr);
|
|
|
| - // Record source code position before IC call.
|
| - SetSourcePosition(expr->position());
|
| // Call keyed store IC.
|
| // The arguments are:
|
| // - a0 is the value,
|
| @@ -2896,6 +2898,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
|
|
|
| void FullCodeGenerator::VisitProperty(Property* expr) {
|
| Comment cmnt(masm_, "[ Property");
|
| + SetExpressionPosition(expr);
|
| +
|
| Expression* key = expr->key();
|
|
|
| if (key->IsPropertyName()) {
|
| @@ -2971,12 +2975,12 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
|
|
|
|
|
| void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
|
| + SetExpressionPosition(expr);
|
| Expression* callee = expr->expression();
|
| DCHECK(callee->IsProperty());
|
| Property* prop = callee->AsProperty();
|
| DCHECK(prop->IsSuperAccess());
|
|
|
| - SetSourcePosition(prop->position());
|
| Literal* key = prop->key()->AsLiteral();
|
| DCHECK(!key->value()->IsSmi());
|
| // Load the function from the receiver.
|
| @@ -3038,7 +3042,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
|
| Property* prop = callee->AsProperty();
|
| DCHECK(prop->IsSuperAccess());
|
|
|
| - SetSourcePosition(prop->position());
|
| + SetExpressionPosition(prop);
|
| // Load the function from the receiver.
|
| const Register scratch = a1;
|
| SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
|
| @@ -3072,14 +3076,12 @@ void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) {
|
| // Load the arguments.
|
| ZoneList<Expression*>* args = expr->arguments();
|
| int arg_count = args->length();
|
| - { PreservePositionScope scope(masm()->positions_recorder());
|
| - for (int i = 0; i < arg_count; i++) {
|
| - VisitForStackValue(args->at(i));
|
| - }
|
| + for (int i = 0; i < arg_count; i++) {
|
| + VisitForStackValue(args->at(i));
|
| }
|
|
|
| // Record source position of the IC call.
|
| - SetSourcePosition(expr->position());
|
| + SetExpressionPosition(expr);
|
| Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, call_type).code();
|
| __ li(a3, Operand(SmiFromSlot(expr->CallFeedbackICSlot())));
|
| __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize));
|
| @@ -3137,13 +3139,11 @@ void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) {
|
| VariableProxy* callee = expr->expression()->AsVariableProxy();
|
| if (callee->var()->IsLookupSlot()) {
|
| Label slow, done;
|
| - SetSourcePosition(callee->position());
|
| - {
|
| - PreservePositionScope scope(masm()->positions_recorder());
|
| - // Generate code for loading from variables potentially shadowed
|
| - // by eval-introduced variables.
|
| - EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done);
|
| - }
|
| +
|
| + SetExpressionPosition(callee);
|
| + // Generate code for loading from variables potentially shadowed by
|
| + // eval-introduced variables.
|
| + EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done);
|
|
|
| __ bind(&slow);
|
| // Call the runtime to find the function to call (returned in v0)
|
| @@ -3196,8 +3196,6 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| // function using the given arguments.
|
| ZoneList<Expression*>* args = expr->arguments();
|
| int arg_count = args->length();
|
| -
|
| - { PreservePositionScope pos_scope(masm()->positions_recorder());
|
| PushCalleeAndWithBaseObject(expr);
|
|
|
| // Push the arguments.
|
| @@ -3215,9 +3213,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| __ sd(v0, MemOperand(sp, (arg_count + 1) * kPointerSize));
|
|
|
| PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS);
|
| - }
|
| // Record source position for debugger.
|
| - SetSourcePosition(expr->position());
|
| + SetExpressionPosition(expr);
|
| CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
|
| __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize));
|
| __ CallStub(&stub);
|
| @@ -3241,10 +3238,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| EmitKeyedSuperCallWithLoadIC(expr);
|
| }
|
| } else {
|
| - {
|
| - PreservePositionScope scope(masm()->positions_recorder());
|
| VisitForStackValue(property->obj());
|
| - }
|
| if (is_named_call) {
|
| EmitCallWithLoadIC(expr);
|
| } else {
|
| @@ -3256,9 +3250,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| } else {
|
| DCHECK(call_type == Call::OTHER_CALL);
|
| // Call to an arbitrary expression not handled specially above.
|
| - { PreservePositionScope scope(masm()->positions_recorder());
|
| VisitForStackValue(callee);
|
| - }
|
| __ LoadRoot(a1, Heap::kUndefinedValueRootIndex);
|
| __ push(a1);
|
| // Emit function call.
|
| @@ -3293,7 +3285,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
|
|
| // Call the construct call builtin that handles allocation and
|
| // constructor invocation.
|
| - SetSourcePosition(expr->position());
|
| + SetExpressionPosition(expr);
|
|
|
| // Load function and argument count into a1 and a0.
|
| __ li(a0, Operand(arg_count));
|
| @@ -3336,7 +3328,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
|
|
| // Call the construct call builtin that handles allocation and
|
| // constructor invocation.
|
| - SetSourcePosition(expr->position());
|
| + SetExpressionPosition(expr);
|
|
|
| // Load function and argument count into a1 and a0.
|
| __ li(a0, Operand(arg_count));
|
| @@ -4752,8 +4744,7 @@ void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
|
| ZoneList<Expression*>* args = expr->arguments();
|
| int arg_count = args->length();
|
|
|
| - // Record source position of the IC call.
|
| - SetSourcePosition(expr->position());
|
| + SetExpressionPosition(expr);
|
| CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
|
| __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize));
|
| __ CallStub(&stub);
|
| @@ -4930,7 +4921,6 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
|
| DCHECK(expr->expression()->IsValidReferenceExpression());
|
|
|
| Comment cmnt(masm_, "[ CountOperation");
|
| - SetSourcePosition(expr->position());
|
|
|
| Property* prop = expr->expression()->AsProperty();
|
| LhsKind assign_type = Property::GetAssignType(prop);
|
| @@ -5087,8 +5077,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
|
| __ mov(a1, v0);
|
| __ li(a0, Operand(Smi::FromInt(count_value)));
|
|
|
| - // Record position before stub call.
|
| - SetSourcePosition(expr->position());
|
| + SetExpressionPosition(expr);
|
| +
|
|
|
| Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD,
|
| strength(language_mode())).code();
|
| @@ -5304,7 +5294,7 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr,
|
|
|
| void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
|
| Comment cmnt(masm_, "[ CompareOperation");
|
| - SetSourcePosition(expr->position());
|
| + SetExpressionPosition(expr);
|
|
|
| // First we try a fast inlined version of the compare when one of
|
| // the operands is a literal.
|
| @@ -5355,8 +5345,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
|
| Split(cc, a1, Operand(a0), if_true, if_false, NULL);
|
| __ bind(&slow_case);
|
| }
|
| - // Record position and call the compare IC.
|
| - SetSourcePosition(expr->position());
|
| +
|
| Handle<Code> ic = CodeFactory::CompareIC(
|
| isolate(), op, strength(language_mode())).code();
|
| CallIC(ic, expr->CompareOperationFeedbackId());
|
|
|