Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
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();
int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta);
#if V8_TARGET_ARCH_PPC64
}
// 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());
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);
// 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());
__ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
__ cmp(r3, ip);
// 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 r3, load the length to r4.
__ LoadP(r3, MemOperand(sp, 0 * kPointerSize));
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();
DCHECK(expr->target()->IsValidReferenceExpression());
Comment cmnt(masm_, "[ Assignment");
+ SetExpressionPosition(expr, INSERT_BREAK);
Property* property = expr->target()->AsProperty();
LhsKind assign_type = Property::GetAssignType(property);
__ push(r3); // Left operand goes on the stack.
VisitForAccumulatorValue(expr->value());
- SetSourcePosition(expr->position() + 1);
AccumulatorValueContext context(this);
if (ShouldInlineSmiCase(op)) {
EmitInlineSmiBinaryOp(expr->binary_operation(), op, expr->target(),
VisitForAccumulatorValue(expr->value());
}
- // Record source position before possible IC call.
- SetSourcePosition(expr->position());
+ SetExpressionPosition(expr);
// Store the value.
switch (assign_type) {
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());
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
- SetSourcePosition(prop->position());
+ SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!prop->IsSuperAccess());
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());
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
- SetSourcePosition(prop->position());
+ SetExpressionPosition(prop);
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), language_mode()).code();
__ mov(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
+ SetExpressionPosition(prop);
__ Push(Smi::FromInt(language_mode()));
- SetSourcePosition(prop->position());
-
__ CallRuntime(Runtime::kLoadKeyedFromSuper, 4);
}
DCHECK(prop != NULL);
DCHECK(prop->key()->IsLiteral());
- // Record source code position before IC call.
- SetSourcePosition(expr->position());
__ mov(StoreDescriptor::NameRegister(),
Operand(prop->key()->AsLiteral()->value()));
__ pop(StoreDescriptor::ReceiverRegister());
void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
// Assignment to a property, using a keyed store IC.
-
- // Record source code position before IC call.
- SetSourcePosition(expr->position());
__ Pop(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister());
DCHECK(StoreDescriptor::ValueRegister().is(r3));
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
+ SetExpressionPosition(expr);
+
Expression* key = expr->key();
if (key->IsPropertyName()) {
DCHECK(callee->IsProperty());
Property* prop = callee->AsProperty();
DCHECK(prop->IsSuperAccess());
+ SetExpressionPosition(prop);
- SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
DCHECK(!key->value()->IsSmi());
// Load the function from the receiver.
Property* prop = callee->AsProperty();
DCHECK(prop->IsSuperAccess());
- SetSourcePosition(prop->position());
+ SetExpressionPosition(prop);
// Load the function from the receiver.
const Register scratch = r4;
SuperPropertyReference* super_ref = prop->obj()->AsSuperPropertyReference();
// 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();
__ LoadSmiLiteral(r6, SmiFromSlot(expr->CallFeedbackICSlot()));
__ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0);
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 r3) and
// the object holding it (returned in r4).
ZoneList<Expression*>* args = expr->arguments();
int arg_count = args->length();
- {
- PreservePositionScope pos_scope(masm()->positions_recorder());
- PushCalleeAndWithBaseObject(expr);
+ PushCalleeAndWithBaseObject(expr);
- // Push the arguments.
- for (int i = 0; i < arg_count; i++) {
- VisitForStackValue(args->at(i));
- }
+ // Push the arguments.
+ for (int i = 0; i < arg_count; i++) {
+ VisitForStackValue(args->at(i));
+ }
- // Push a copy of the function (found below the arguments) and
- // resolve eval.
- __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0);
- __ push(r4);
- EmitResolvePossiblyDirectEval(arg_count);
+ // Push a copy of the function (found below the arguments) and
+ // resolve eval.
+ __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0);
+ __ push(r4);
+ EmitResolvePossiblyDirectEval(arg_count);
- // Touch up the stack with the resolved function.
- __ StoreP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0);
+ // Touch up the stack with the resolved function.
+ __ StoreP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0);
- PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS);
- }
+ PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS);
// Record source position for debugger.
- SetSourcePosition(expr->position());
+ SetExpressionPosition(expr);
CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
__ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0);
__ CallStub(&stub);
EmitKeyedSuperCallWithLoadIC(expr);
}
} else {
- {
- PreservePositionScope scope(masm()->positions_recorder());
- VisitForStackValue(property->obj());
- }
+ VisitForStackValue(property->obj());
if (is_named_call) {
EmitCallWithLoadIC(expr);
} else {
} else {
DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above.
- {
- PreservePositionScope scope(masm()->positions_recorder());
- VisitForStackValue(callee);
- }
+ VisitForStackValue(callee);
__ LoadRoot(r4, Heap::kUndefinedValueRootIndex);
__ push(r4);
// Emit function call.
// Call the construct call builtin that handles allocation and
// constructor invocation.
- SetSourcePosition(expr->position());
+ SetExpressionPosition(expr);
// Load function and argument count into r4 and r3.
__ mov(r3, Operand(arg_count));
// Call the construct call builtin that handles allocation and
// constructor invocation.
- SetSourcePosition(expr->position());
+ SetExpressionPosition(expr);
// Load function and argument count into r1 and r0.
__ mov(r3, Operand(arg_count));
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);
__ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0);
__ CallStub(&stub);
DCHECK(expr->expression()->IsValidReferenceExpression());
Comment cmnt(masm_, "[ CountOperation");
- SetSourcePosition(expr->position());
Property* prop = expr->expression()->AsProperty();
LhsKind assign_type = Property::GetAssignType(prop);
__ mr(r4, r3);
__ LoadSmiLiteral(r3, 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();
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.
__ 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());