| Index: src/frames-inl.h
|
| diff --git a/src/frames-inl.h b/src/frames-inl.h
|
| index 650d6f9725f4ab30df736034093d6b426bbc2fb9..1a1138e24d691d95c009354fffbf9d8abe347356 100644
|
| --- a/src/frames-inl.h
|
| +++ b/src/frames-inl.h
|
| @@ -158,7 +158,7 @@ inline JavaScriptFrame::JavaScriptFrame(StackFrameIteratorBase* iterator)
|
|
|
| Address JavaScriptFrame::GetParameterSlot(int index) const {
|
| int param_count = ComputeParametersCount();
|
| - DCHECK(-1 <= index && index < param_count);
|
| + // DCHECK(-1 <= index && index < param_count);
|
| int parameter_offset = (param_count - index - 1) * kPointerSize;
|
| return caller_sp() + parameter_offset;
|
| }
|
| @@ -217,6 +217,26 @@ inline JSFunction* JavaScriptFrame::function() const {
|
| }
|
|
|
|
|
| +inline Object* JavaScriptFrame::NewTarget() const {
|
| + if (!IsConstructor()) {
|
| + return isolate()->heap()->undefined_value();
|
| + }
|
| +
|
| + Address fp = this->fp();
|
| + if (has_adapted_arguments()) {
|
| + fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset);
|
| + }
|
| +
|
| + int param_count = GetArgumentsLength();
|
| + // One for return address
|
| + // One for receiver
|
| + // One for original constructor
|
| + Object* new_target = Memory::Object_at(fp + (3 + param_count) * kPointerSize);
|
| + DCHECK(new_target->IsJSFunction());
|
| + return new_target;
|
| +}
|
| +
|
| +
|
| inline StubFrame::StubFrame(StackFrameIteratorBase* iterator)
|
| : StandardFrame(iterator) {
|
| }
|
|
|