Commit 5b742b35 authored by jarin@chromium.org's avatar jarin@chromium.org

Adding more missing deoptimization points in Turbofan.

BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/595863002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d5e33ac3
......@@ -2892,6 +2892,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// r1 (receiver). Touch up the stack with the right values.
__ str(r0, MemOperand(sp, (arg_count + 1) * kPointerSize));
__ str(r1, MemOperand(sp, arg_count * kPointerSize));
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
}
// Record source position for debugger.
......@@ -2925,6 +2927,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
__ Push(context_register(), r2);
__ CallRuntime(Runtime::kLoadLookupSlot, 2);
__ Push(r0, r1); // Function, receiver.
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
// If fast case code has been generated, emit code to push the
// function and receiver and have the slow path jump around this
......
......@@ -2557,6 +2557,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// The runtime call returns a pair of values in x0 (function) and
// x1 (receiver). Touch up the stack with the right values.
__ PokePair(x1, x0, arg_count * kPointerSize);
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
}
// Record source position for debugger.
......@@ -2592,6 +2594,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
__ Push(context_register(), x10);
__ CallRuntime(Runtime::kLoadLookupSlot, 2);
__ Push(x0, x1); // Receiver, function.
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
// If fast case code has been generated, emit code to push the
// function and receiver and have the slow path jump around this
......
......@@ -1796,6 +1796,7 @@ class Call FINAL : public Expression, public FeedbackSlotInterface {
bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupIterator* it);
BailoutId ReturnId() const { return return_id_; }
BailoutId EvalOrLookupId() const { return eval_or_lookup_id_; }
enum CallType {
POSSIBLY_EVAL_CALL,
......@@ -1821,7 +1822,8 @@ class Call FINAL : public Expression, public FeedbackSlotInterface {
expression_(expression),
arguments_(arguments),
call_feedback_slot_(kInvalidFeedbackSlot),
return_id_(id_gen->GetNextId()) {
return_id_(id_gen->GetNextId()),
eval_or_lookup_id_(id_gen->GetNextId()) {
if (expression->IsProperty()) {
expression->AsProperty()->mark_for_call();
}
......@@ -1837,6 +1839,9 @@ class Call FINAL : public Expression, public FeedbackSlotInterface {
int call_feedback_slot_;
const BailoutId return_id_;
// TODO(jarin) Only allocate the bailout id for the POSSIBLY_EVAL_CALL and
// LOOKUP_SLOT_CALL types.
const BailoutId eval_or_lookup_id_;
};
......
This diff is collapsed.
......@@ -80,7 +80,8 @@ class AstGraphBuilder : public StructuredGraphBuilder, public AstVisitor {
// Builders for variable load and assignment.
Node* BuildVariableAssignment(Variable* var, Node* value, Token::Value op,
BailoutId bailout_id);
Node* BuildVariableDelete(Variable* var);
Node* BuildVariableDelete(Variable* var, BailoutId bailout_id,
OutputFrameStateCombine state_combine);
Node* BuildVariableLoad(Variable* var, BailoutId bailout_id,
ContextualMode mode = CONTEXTUAL);
......@@ -94,11 +95,12 @@ class AstGraphBuilder : public StructuredGraphBuilder, public AstVisitor {
Node* BuildToBoolean(Node* value);
// Builders for error reporting at runtime.
Node* BuildThrowReferenceError(Variable* var);
Node* BuildThrowReferenceError(Variable* var, BailoutId bailout_id);
// Builders for dynamic hole-checks at runtime.
Node* BuildHoleCheckSilent(Node* value, Node* for_hole, Node* not_hole);
Node* BuildHoleCheckThrow(Node* value, Variable* var, Node* not_hole);
Node* BuildHoleCheckThrow(Node* value, Variable* var, Node* not_hole,
BailoutId bailout_id);
// Builders for binary operations.
Node* BuildBinaryOp(Node* left, Node* right, Token::Value op);
......@@ -173,8 +175,9 @@ class AstGraphBuilder : public StructuredGraphBuilder, public AstVisitor {
void VisitForInAssignment(Expression* expr, Node* value);
// Builds deoptimization for a given node.
void PrepareFrameState(Node* node, BailoutId ast_id,
OutputFrameStateCombine combine = kIgnoreOutput);
void PrepareFrameState(
Node* node, BailoutId ast_id,
OutputFrameStateCombine combine = OutputFrameStateCombine::Ignore());
OutputFrameStateCombine StateCombineFromAstContext();
......@@ -288,7 +291,8 @@ class AstGraphBuilder::AstContext BASE_EMBEDDED {
// Determines how to combine the frame state with the value
// that is about to be plugged into this AstContext.
OutputFrameStateCombine GetStateCombine() {
return IsEffect() ? kIgnoreOutput : kPushOutput;
return IsEffect() ? OutputFrameStateCombine::Ignore()
: OutputFrameStateCombine::Push();
}
// Plug a node into this expression context. Call this function in tail
......
......@@ -260,15 +260,15 @@ void CodeGenerator::AddSafepointAndDeopt(Instruction* instr) {
// because it is only used to get locals and arguments (by the debugger and
// f.arguments), and those are the same in the pre-call and post-call
// states.
if (descriptor->state_combine() != kIgnoreOutput) {
deopt_state_id =
BuildTranslation(instr, -1, frame_state_offset, kIgnoreOutput);
if (!descriptor->state_combine().IsOutputIgnored()) {
deopt_state_id = BuildTranslation(instr, -1, frame_state_offset,
OutputFrameStateCombine::Ignore());
}
#if DEBUG
// Make sure all the values live in stack slots or they are immediates.
// (The values should not live in register because registers are clobbered
// by calls.)
for (size_t i = 0; i < descriptor->size(); i++) {
for (size_t i = 0; i < descriptor->GetSize(); i++) {
InstructionOperand* op = instr->InputAt(frame_state_offset + 1 + i);
CHECK(op->IsStackSlot() || op->IsImmediate());
}
......@@ -296,6 +296,33 @@ FrameStateDescriptor* CodeGenerator::GetFrameStateDescriptor(
return code()->GetFrameStateDescriptor(state_id);
}
static InstructionOperand* OperandForFrameState(
FrameStateDescriptor* descriptor, Instruction* instr,
size_t frame_state_offset, size_t index, OutputFrameStateCombine combine) {
DCHECK(index < descriptor->GetSize(combine));
switch (combine.kind()) {
case OutputFrameStateCombine::kPushOutput: {
DCHECK(combine.GetPushCount() <= instr->OutputCount());
size_t size_without_output =
descriptor->GetSize(OutputFrameStateCombine::Ignore());
// If the index is past the existing stack items, return the output.
if (index >= size_without_output) {
return instr->OutputAt(index - size_without_output);
}
break;
}
case OutputFrameStateCombine::kPokeAt:
size_t index_from_top =
descriptor->GetSize(combine) - 1 - combine.GetOffsetToPokeAt();
if (index >= index_from_top &&
index < index_from_top + instr->OutputCount()) {
return instr->OutputAt(index - index_from_top);
}
break;
}
return instr->InputAt(frame_state_offset + index);
}
void CodeGenerator::BuildTranslationForFrameStateDescriptor(
FrameStateDescriptor* descriptor, Instruction* instr,
......@@ -305,7 +332,7 @@ void CodeGenerator::BuildTranslationForFrameStateDescriptor(
if (descriptor->outer_state() != NULL) {
BuildTranslationForFrameStateDescriptor(descriptor->outer_state(), instr,
translation, frame_state_offset,
kIgnoreOutput);
OutputFrameStateCombine::Ignore());
}
int id = Translation::kSelfLiteralId;
......@@ -318,7 +345,8 @@ void CodeGenerator::BuildTranslationForFrameStateDescriptor(
case JS_FRAME:
translation->BeginJSFrame(
descriptor->bailout_id(), id,
static_cast<unsigned int>(descriptor->GetHeight(state_combine)));
static_cast<unsigned int>(descriptor->GetSize(state_combine) -
descriptor->parameters_count()));
break;
case ARGUMENTS_ADAPTOR:
translation->BeginArgumentsAdaptorFrame(
......@@ -327,19 +355,10 @@ void CodeGenerator::BuildTranslationForFrameStateDescriptor(
}
frame_state_offset += descriptor->outer_state()->GetTotalSize();
for (size_t i = 0; i < descriptor->size(); i++) {
AddTranslationForOperand(
translation, instr,
instr->InputAt(static_cast<int>(frame_state_offset + i)));
}
switch (state_combine) {
case kPushOutput:
DCHECK(instr->OutputCount() == 1);
AddTranslationForOperand(translation, instr, instr->OutputAt(0));
break;
case kIgnoreOutput:
break;
for (size_t i = 0; i < descriptor->GetSize(state_combine); i++) {
InstructionOperand* op = OperandForFrameState(
descriptor, instr, frame_state_offset, i, state_combine);
AddTranslationForOperand(translation, instr, op);
}
}
......
......@@ -247,6 +247,50 @@ const Operator* CommonOperatorBuilder::Projection(size_t index) {
1, 1, "Projection", index);
}
OutputFrameStateCombine::OutputFrameStateCombine(CombineKind kind,
size_t parameter)
: kind_(kind), parameter_(parameter) {}
// static
OutputFrameStateCombine OutputFrameStateCombine::Ignore() {
return OutputFrameStateCombine(kPushOutput, 0);
}
// static
OutputFrameStateCombine OutputFrameStateCombine::Push(size_t count) {
return OutputFrameStateCombine(kPushOutput, count);
}
// static
OutputFrameStateCombine OutputFrameStateCombine::PokeAt(size_t index) {
return OutputFrameStateCombine(kPokeAt, index);
}
OutputFrameStateCombine::CombineKind OutputFrameStateCombine::kind() {
return kind_;
}
size_t OutputFrameStateCombine::GetPushCount() {
DCHECK(kind() == kPushOutput);
return parameter_;
}
size_t OutputFrameStateCombine::GetOffsetToPokeAt() {
DCHECK(kind() == kPokeAt);
return parameter_;
}
bool OutputFrameStateCombine::IsOutputIgnored() {
return kind() == kPushOutput && GetPushCount() == 0;
}
} // namespace compiler
} // namespace internal
} // namespace v8
......@@ -26,9 +26,29 @@ class Operator;
// Flag that describes how to combine the current environment with
// the output of a node to obtain a framestate for lazy bailout.
enum OutputFrameStateCombine {
kPushOutput, // Push the output on the expression stack.
kIgnoreOutput // Use the frame state as-is.
class OutputFrameStateCombine {
public:
enum CombineKind {
kPushOutput, // Push the output on the expression stack.
kPokeAt // Poke at the given environment location,
// counting from the top of the stack.
};
static OutputFrameStateCombine Ignore();
static OutputFrameStateCombine Push(size_t count = 1);
static OutputFrameStateCombine PokeAt(size_t index);
CombineKind kind();
size_t GetPushCount();
size_t GetOffsetToPokeAt();
bool IsOutputIgnored();
private:
OutputFrameStateCombine(CombineKind kind, size_t parameter);
CombineKind kind_;
size_t parameter_;
};
......
......@@ -320,8 +320,9 @@ TARGET_TEST_F(InstructionSelectorTest, CallJSFunctionWithDeopt) {
Node* context_dummy = m.Int32Constant(0);
Node* state_node = m.NewNode(
m.common()->FrameState(JS_FRAME, bailout_id, kPushOutput), parameters,
locals, stack, context_dummy, m.UndefinedConstant());
m.common()->FrameState(JS_FRAME, bailout_id,
OutputFrameStateCombine::Push()),
parameters, locals, stack, context_dummy, m.UndefinedConstant());
Node* call = m.CallJS0(function_node, receiver, context, state_node);
m.Return(call);
......@@ -360,7 +361,8 @@ TARGET_TEST_F(InstructionSelectorTest, CallFunctionStubWithDeopt) {
Node* context_sentinel = m.Int32Constant(0);
Node* frame_state_before = m.NewNode(
m.common()->FrameState(JS_FRAME, bailout_id_before, kPushOutput),
m.common()->FrameState(JS_FRAME, bailout_id_before,
OutputFrameStateCombine::Push()),
parameters, locals, stack, context_sentinel, m.UndefinedConstant());
// Build the call.
......@@ -398,7 +400,8 @@ TARGET_TEST_F(InstructionSelectorTest, CallFunctionStubWithDeopt) {
FrameStateDescriptor* desc_before =
s.GetFrameStateDescriptor(deopt_id_before);
EXPECT_EQ(bailout_id_before, desc_before->bailout_id());
EXPECT_EQ(kPushOutput, desc_before->state_combine());
EXPECT_EQ(OutputFrameStateCombine::kPushOutput,
desc_before->state_combine().kind());
EXPECT_EQ(1u, desc_before->parameters_count());
EXPECT_EQ(1u, desc_before->locals_count());
EXPECT_EQ(1u, desc_before->stack_count());
......@@ -435,18 +438,20 @@ TARGET_TEST_F(InstructionSelectorTest,
Node* parameters = m.NewNode(m.common()->StateValues(1), m.Int32Constant(63));
Node* locals = m.NewNode(m.common()->StateValues(1), m.Int32Constant(64));
Node* stack = m.NewNode(m.common()->StateValues(1), m.Int32Constant(65));
Node* frame_state_parent = m.NewNode(
m.common()->FrameState(JS_FRAME, bailout_id_parent, kIgnoreOutput),
parameters, locals, stack, context, m.UndefinedConstant());
Node* frame_state_parent =
m.NewNode(m.common()->FrameState(JS_FRAME, bailout_id_parent,
OutputFrameStateCombine::Ignore()),
parameters, locals, stack, context, m.UndefinedConstant());
Node* context2 = m.Int32Constant(46);
Node* parameters2 =
m.NewNode(m.common()->StateValues(1), m.Int32Constant(43));
Node* locals2 = m.NewNode(m.common()->StateValues(1), m.Int32Constant(44));
Node* stack2 = m.NewNode(m.common()->StateValues(1), m.Int32Constant(45));
Node* frame_state_before = m.NewNode(
m.common()->FrameState(JS_FRAME, bailout_id_before, kPushOutput),
parameters2, locals2, stack2, context2, frame_state_parent);
Node* frame_state_before =
m.NewNode(m.common()->FrameState(JS_FRAME, bailout_id_before,
OutputFrameStateCombine::Push()),
parameters2, locals2, stack2, context2, frame_state_parent);
// Build the call.
Node* call = m.CallFunctionStub0(function_node, receiver, context2,
......
......@@ -736,32 +736,29 @@ class FrameStateDescriptor : public ZoneObject {
FrameStateDescriptor* outer_state() const { return outer_state_; }
MaybeHandle<JSFunction> jsfunction() const { return jsfunction_; }
size_t size() const {
return parameters_count_ + locals_count_ + stack_count_ +
(HasContext() ? 1 : 0);
size_t GetSize(OutputFrameStateCombine combine =
OutputFrameStateCombine::Ignore()) const {
size_t size = parameters_count_ + locals_count_ + stack_count_ +
(HasContext() ? 1 : 0);
switch (combine.kind()) {
case OutputFrameStateCombine::kPushOutput:
size += combine.GetPushCount();
break;
case OutputFrameStateCombine::kPokeAt:
break;
}
return size;
}
size_t GetTotalSize() const {
size_t total_size = 0;
for (const FrameStateDescriptor* iter = this; iter != NULL;
iter = iter->outer_state_) {
total_size += iter->size();
total_size += iter->GetSize();
}
return total_size;
}
size_t GetHeight(OutputFrameStateCombine override) const {
size_t height = size() - parameters_count();
switch (override) {
case kPushOutput:
++height;
break;
case kIgnoreOutput:
break;
}
return height;
}
size_t GetFrameCount() const {
size_t count = 0;
for (const FrameStateDescriptor* iter = this; iter != NULL;
......
......@@ -198,8 +198,8 @@ void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
int nargs) {
Callable callable =
CodeFactory::CallFunction(isolate(), nargs - 1, NO_CALL_FUNCTION_FLAGS);
CallDescriptor* desc =
linkage()->GetStubCallDescriptor(callable.descriptor(), nargs);
CallDescriptor* desc = linkage()->GetStubCallDescriptor(
callable.descriptor(), nargs, FlagsForNode(node));
// TODO(mstarzinger): Accessing the builtins object this way prevents sharing
// of code across native contexts. Fix this by loading from given context.
Handle<JSFunction> function(
......@@ -260,7 +260,7 @@ void JSGenericLowering::LowerJSToBoolean(Node* node) {
void JSGenericLowering::LowerJSToNumber(Node* node) {
Callable callable = CodeFactory::ToNumber(isolate());
ReplaceWithStubCall(node, callable, CallDescriptor::kNoFlags);
ReplaceWithStubCall(node, callable, FlagsForNode(node));
}
......@@ -321,7 +321,8 @@ void JSGenericLowering::LowerJSInstanceOf(Node* node) {
InstanceofStub::kArgsInRegisters);
InstanceofStub stub(isolate(), flags);
CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
CallDescriptor* desc = linkage()->GetStubCallDescriptor(d, 0);
CallDescriptor* desc =
linkage()->GetStubCallDescriptor(d, 0, FlagsForNode(node));
Node* stub_code = CodeConstant(stub.GetCode());
PatchInsertInput(node, 0, stub_code);
PatchOperator(node, common()->Call(desc));
......
......@@ -348,9 +348,9 @@ void JSInliner::AddClosureToFrameState(Node* frame_state,
Node* JSInliner::CreateArgumentsAdaptorFrameState(JSCallFunctionAccessor* call,
Handle<JSFunction> jsfunction,
Zone* temp_zone) {
const Operator* op =
jsgraph_->common()->FrameState(FrameStateType::ARGUMENTS_ADAPTOR,
BailoutId(-1), kIgnoreOutput, jsfunction);
const Operator* op = jsgraph_->common()->FrameState(
FrameStateType::ARGUMENTS_ADAPTOR, BailoutId(-1),
OutputFrameStateCombine::Ignore(), jsfunction);
const Operator* op0 = jsgraph_->common()->StateValues(0);
Node* node0 = jsgraph_->graph()->NewNode(op0);
NodeVector params(temp_zone);
......
......@@ -116,16 +116,67 @@ bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
// TODO(jarin) At the moment, we only add frame state for
// few chosen runtime functions.
switch (function) {
case Runtime::kApply:
case Runtime::kArrayBufferNeuter:
case Runtime::kArrayConcat:
case Runtime::kBasicJSONStringify:
case Runtime::kCheckExecutionState:
case Runtime::kCollectStackTrace:
case Runtime::kCompileLazy:
case Runtime::kCompileOptimized:
case Runtime::kCompileString:
case Runtime::kDebugBreak:
case Runtime::kDataViewSetInt8:
case Runtime::kDataViewSetUint8:
case Runtime::kDataViewSetInt16:
case Runtime::kDataViewSetUint16:
case Runtime::kDataViewSetInt32:
case Runtime::kDataViewSetUint32:
case Runtime::kDataViewSetFloat32:
case Runtime::kDataViewSetFloat64:
case Runtime::kDataViewGetInt8:
case Runtime::kDataViewGetUint8:
case Runtime::kDataViewGetInt16:
case Runtime::kDataViewGetUint16:
case Runtime::kDataViewGetInt32:
case Runtime::kDataViewGetUint32:
case Runtime::kDataViewGetFloat32:
case Runtime::kDataViewGetFloat64:
case Runtime::kDebugEvaluate:
case Runtime::kDebugGetLoadedScripts:
case Runtime::kDebugGetPropertyDetails:
case Runtime::kDebugPromiseRejectEvent:
case Runtime::kDebugPromiseEvent:
case Runtime::kDeleteProperty:
case Runtime::kDeoptimizeFunction:
case Runtime::kFunctionBindArguments:
case Runtime::kGetFrameCount:
case Runtime::kGetOwnProperty:
case Runtime::kInlineCallFunction:
case Runtime::kInlineDateField:
case Runtime::kInlineRegExpExec:
case Runtime::kLiveEditGatherCompileInfo:
case Runtime::kLoadLookupSlot:
case Runtime::kLoadLookupSlotNoReferenceError:
case Runtime::kMaterializeRegExpLiteral:
case Runtime::kNewObjectFromBound:
case Runtime::kObjectFreeze:
case Runtime::kParseJson:
case Runtime::kPrepareStep:
case Runtime::kPreventExtensions:
case Runtime::kRegExpCompile:
case Runtime::kRegExpExecMultiple:
case Runtime::kResolvePossiblyDirectEval:
// case Runtime::kSetPrototype:
case Runtime::kSetScriptBreakPoint:
case Runtime::kStackGuard:
case Runtime::kCheckExecutionState:
case Runtime::kDebugEvaluate:
case Runtime::kCollectStackTrace:
case Runtime::kStoreLookupSlot:
case Runtime::kStringBuilderConcat:
case Runtime::kStringReplaceGlobalRegExpWithString:
case Runtime::kThrowReferenceError:
case Runtime::kThrow:
case Runtime::kTypedArraySetFastCases:
case Runtime::kTypedArrayInitializeFromArrayLike:
return true;
default:
return false;
......
......@@ -55,28 +55,33 @@ inline bool OperatorProperties::HasFrameStateInput(const Operator* op) {
// Compare operations
case IrOpcode::kJSEqual:
case IrOpcode::kJSNotEqual:
case IrOpcode::kJSLessThan:
case IrOpcode::kJSGreaterThan:
case IrOpcode::kJSLessThanOrEqual:
case IrOpcode::kJSGreaterThanOrEqual:
case IrOpcode::kJSHasProperty:
case IrOpcode::kJSInstanceOf:
case IrOpcode::kJSLessThan:
case IrOpcode::kJSLessThanOrEqual:
case IrOpcode::kJSNotEqual:
// Binary operations
case IrOpcode::kJSAdd:
case IrOpcode::kJSBitwiseAnd:
case IrOpcode::kJSBitwiseOr:
case IrOpcode::kJSBitwiseXor:
case IrOpcode::kJSBitwiseAnd:
case IrOpcode::kJSDivide:
case IrOpcode::kJSLoadNamed:
case IrOpcode::kJSLoadProperty:
case IrOpcode::kJSModulus:
case IrOpcode::kJSMultiply:
case IrOpcode::kJSShiftLeft:
case IrOpcode::kJSShiftRight:
case IrOpcode::kJSShiftRightLogical:
case IrOpcode::kJSAdd:
case IrOpcode::kJSSubtract:
case IrOpcode::kJSMultiply:
case IrOpcode::kJSDivide:
case IrOpcode::kJSModulus:
case IrOpcode::kJSLoadProperty:
case IrOpcode::kJSStoreProperty:
case IrOpcode::kJSLoadNamed:
case IrOpcode::kJSStoreNamed:
case IrOpcode::kJSStoreProperty:
case IrOpcode::kJSSubtract:
// Other
case IrOpcode::kJSDeleteProperty:
return true;
default:
......
......@@ -2798,6 +2798,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// edx (receiver). Touch up the stack with the right values.
__ mov(Operand(esp, (arg_count + 0) * kPointerSize), edx);
__ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax);
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
}
// Record source position for debugger.
SetSourcePosition(expr->position());
......@@ -2829,6 +2831,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
__ CallRuntime(Runtime::kLoadLookupSlot, 2);
__ push(eax); // Function.
__ push(edx); // Receiver.
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
// If fast case code has been generated, emit code to push the function
// and receiver and have the slow path jump around this code.
......
......@@ -2871,6 +2871,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// v1 (receiver). Touch up the stack with the right values.
__ sw(v0, MemOperand(sp, (arg_count + 1) * kPointerSize));
__ sw(v1, MemOperand(sp, arg_count * kPointerSize));
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
}
// Record source position for debugger.
SetSourcePosition(expr->position());
......@@ -2902,6 +2904,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
__ Push(context_register(), a2);
__ CallRuntime(Runtime::kLoadLookupSlot, 2);
__ Push(v0, v1); // Function, receiver.
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
// If fast case code has been generated, emit code to push the
// function and receiver and have the slow path jump around this
......
......@@ -2870,6 +2870,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// v1 (receiver). Touch up the stack with the right values.
__ sd(v0, MemOperand(sp, (arg_count + 1) * kPointerSize));
__ sd(v1, MemOperand(sp, arg_count * kPointerSize));
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
}
// Record source position for debugger.
SetSourcePosition(expr->position());
......@@ -2901,6 +2903,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
__ Push(context_register(), a2);
__ CallRuntime(Runtime::kLoadLookupSlot, 2);
__ Push(v0, v1); // Function, receiver.
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
// If fast case code has been generated, emit code to push the
// function and receiver and have the slow path jump around this
......
......@@ -2795,6 +2795,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// rdx (receiver). Touch up the stack with the right values.
__ movp(Operand(rsp, (arg_count + 0) * kPointerSize), rdx);
__ movp(Operand(rsp, (arg_count + 1) * kPointerSize), rax);
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
}
// Record source position for debugger.
SetSourcePosition(expr->position());
......@@ -2826,6 +2828,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
__ CallRuntime(Runtime::kLoadLookupSlot, 2);
__ Push(rax); // Function.
__ Push(rdx); // Receiver.
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
// If fast case code has been generated, emit code to push the function
// and receiver and have the slow path jump around this code.
......
......@@ -2785,6 +2785,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// edx (receiver). Touch up the stack with the right values.
__ mov(Operand(esp, (arg_count + 0) * kPointerSize), edx);
__ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax);
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
}
// Record source position for debugger.
SetSourcePosition(expr->position());
......@@ -2816,6 +2818,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
__ CallRuntime(Runtime::kLoadLookupSlot, 2);
__ push(eax); // Function.
__ push(edx); // Receiver.
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS);
// If fast case code has been generated, emit code to push the function
// and receiver and have the slow path jump around this code.
......
......@@ -145,8 +145,9 @@ class TrivialDeoptCodegenTester : public DeoptCodegenTester {
Node* stack = m.NewNode(common.StateValues(0));
Node* state_node = m.NewNode(
common.FrameState(JS_FRAME, bailout_id, kIgnoreOutput), parameters,
locals, stack, caller_context_node, m.UndefinedConstant());
common.FrameState(JS_FRAME, bailout_id,
OutputFrameStateCombine::Ignore()),
parameters, locals, stack, caller_context_node, m.UndefinedConstant());
Handle<Context> context(deopt_function->context(), CcTest::i_isolate());
Unique<Object> context_constant =
......@@ -259,8 +260,9 @@ class TrivialRuntimeDeoptCodegenTester : public DeoptCodegenTester {
Node* stack = m.NewNode(common.StateValues(0));
Node* state_node = m.NewNode(
common.FrameState(JS_FRAME, bailout_id, kIgnoreOutput), parameters,
locals, stack, context_node, m.UndefinedConstant());
common.FrameState(JS_FRAME, bailout_id,
OutputFrameStateCombine::Ignore()),
parameters, locals, stack, context_node, m.UndefinedConstant());
m.CallRuntime1(Runtime::kDeoptimizeFunction, this_fun_node, context_node,
state_node);
......
......@@ -65,7 +65,8 @@ class JSTypedLoweringTester : public HandleAndZoneScope {
Node* stack = graph.NewNode(common.StateValues(0));
Node* state_node =
graph.NewNode(common.FrameState(JS_FRAME, BailoutId(0), kIgnoreOutput),
graph.NewNode(common.FrameState(JS_FRAME, BailoutId(0),
OutputFrameStateCombine::Ignore()),
parameters, locals, stack, context, UndefinedConstant());
return state_node;
......
......@@ -27,6 +27,7 @@
// On MacOS X 10.7.5, this test needs a stack size of at least 788 kBytes.
// Flags: --stack-size=800
// Flags: --turbo-deoptimization
// Test that we can make large object literals that work.
// Also test that we can attempt to make even larger object literals without
......
......@@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --expose-debug-as debug
// Flags: --expose-debug-as debug --turbo-deoptimization
// Get the Debug object exposed from the debug context global object.
Debug = debug.Debug
......
......@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --turbo-deoptimization
for (var i = 0; i < 10000; i++) {
try {
var object = { };
......
......@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --turbo-deoptimization
function CheckStrictMode(code, exception) {
assertDoesNotThrow(code);
assertThrows("'use strict';\n" + code, exception);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment