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

Side by Side Diff: src/full-codegen/full-codegen.cc

Issue 2488493003: [inspector] fix positions for single expression arrow function (Closed)
Patch Set: addressed comments Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/ast/ast.h ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/full-codegen/full-codegen.h" 5 #include "src/full-codegen/full-codegen.h"
6 6
7 #include "src/ast/ast-numbering.h" 7 #include "src/ast/ast-numbering.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 675
676 676
677 void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) { 677 void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) {
678 RecordPosition(fun->start_position()); 678 RecordPosition(fun->start_position());
679 } 679 }
680 680
681 681
682 void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) { 682 void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) {
683 // For default constructors, start position equals end position, and there 683 // For default constructors, start position equals end position, and there
684 // is no source code besides the class literal. 684 // is no source code besides the class literal.
685 int pos = std::max(fun->start_position(), fun->end_position() - 1); 685 RecordStatementPosition(fun->return_position());
686 RecordStatementPosition(pos);
687 if (info_->is_debug()) { 686 if (info_->is_debug()) {
688 // Always emit a debug break slot before a return. 687 // Always emit a debug break slot before a return.
689 DebugCodegen::GenerateSlot(masm_, RelocInfo::DEBUG_BREAK_SLOT_AT_RETURN); 688 DebugCodegen::GenerateSlot(masm_, RelocInfo::DEBUG_BREAK_SLOT_AT_RETURN);
690 } 689 }
691 } 690 }
692 691
693 692
694 void FullCodeGenerator::SetStatementPosition( 693 void FullCodeGenerator::SetStatementPosition(
695 Statement* stmt, FullCodeGenerator::InsertBreak insert_break) { 694 Statement* stmt, FullCodeGenerator::InsertBreak insert_break) {
696 if (stmt->position() == kNoSourcePosition) return; 695 if (stmt->position() == kNoSourcePosition) return;
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1991 return info_->has_simple_parameters(); 1990 return info_->has_simple_parameters();
1992 } 1991 }
1993 1992
1994 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } 1993 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); }
1995 1994
1996 #undef __ 1995 #undef __
1997 1996
1998 1997
1999 } // namespace internal 1998 } // namespace internal
2000 } // namespace v8 1999 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast.h ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698