| OLD | NEW |
| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 417 } |
| 418 | 418 |
| 419 | 419 |
| 420 void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) { | 420 void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) { |
| 421 RecordPosition(masm_, fun->start_position()); | 421 RecordPosition(masm_, fun->start_position()); |
| 422 } | 422 } |
| 423 | 423 |
| 424 | 424 |
| 425 void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) { | 425 void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) { |
| 426 RecordStatementPosition(masm_, fun->end_position() - 1); | 426 RecordStatementPosition(masm_, fun->end_position() - 1); |
| 427 if (info_->is_debug()) { |
| 428 // Always emit a debug break slot before a return. |
| 429 DebugCodegen::GenerateSlot(masm_, RelocInfo::DEBUG_BREAK_SLOT_AT_RETURN); |
| 430 } |
| 427 } | 431 } |
| 428 | 432 |
| 429 | 433 |
| 430 void FullCodeGenerator::SetStatementPosition( | 434 void FullCodeGenerator::SetStatementPosition( |
| 431 Statement* stmt, FullCodeGenerator::InsertBreak insert_break) { | 435 Statement* stmt, FullCodeGenerator::InsertBreak insert_break) { |
| 432 if (stmt->position() == RelocInfo::kNoPosition) return; | 436 if (stmt->position() == RelocInfo::kNoPosition) return; |
| 433 bool recorded = RecordStatementPosition(masm_, stmt->position()); | 437 bool recorded = RecordStatementPosition(masm_, stmt->position()); |
| 434 if (recorded && insert_break == INSERT_BREAK && info_->is_debug() && | 438 if (recorded && insert_break == INSERT_BREAK && info_->is_debug() && |
| 435 !stmt->IsDebuggerStatement()) { | 439 !stmt->IsDebuggerStatement()) { |
| 436 DebugCodegen::GenerateSlot(masm_, DebugCodegen::PLAIN_DEBUG_BREAK); | 440 DebugCodegen::GenerateSlot(masm_, RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION); |
| 437 } | 441 } |
| 438 } | 442 } |
| 439 | 443 |
| 440 | 444 |
| 441 void FullCodeGenerator::SetExpressionPosition( | 445 void FullCodeGenerator::SetExpressionPosition( |
| 442 Expression* expr, FullCodeGenerator::InsertBreak insert_break) { | 446 Expression* expr, FullCodeGenerator::InsertBreak insert_break) { |
| 443 if (expr->position() == RelocInfo::kNoPosition) return; | 447 if (expr->position() == RelocInfo::kNoPosition) return; |
| 444 bool recorded = RecordPosition(masm_, expr->position()); | 448 bool recorded = RecordPosition(masm_, expr->position()); |
| 445 if (recorded && insert_break == INSERT_BREAK && info_->is_debug()) { | 449 if (recorded && insert_break == INSERT_BREAK && info_->is_debug()) { |
| 446 DebugCodegen::GenerateSlot(masm_, DebugCodegen::PLAIN_DEBUG_BREAK); | 450 DebugCodegen::GenerateSlot(masm_, RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION); |
| 447 } | 451 } |
| 448 } | 452 } |
| 449 | 453 |
| 450 | 454 |
| 451 void FullCodeGenerator::SetExpressionAsStatementPosition(Expression* expr) { | 455 void FullCodeGenerator::SetExpressionAsStatementPosition(Expression* expr) { |
| 452 if (expr->position() == RelocInfo::kNoPosition) return; | 456 if (expr->position() == RelocInfo::kNoPosition) return; |
| 453 bool recorded = RecordStatementPosition(masm_, expr->position()); | 457 bool recorded = RecordStatementPosition(masm_, expr->position()); |
| 454 if (recorded && info_->is_debug()) { | 458 if (recorded && info_->is_debug()) { |
| 455 DebugCodegen::GenerateSlot(masm_, DebugCodegen::PLAIN_DEBUG_BREAK); | 459 DebugCodegen::GenerateSlot(masm_, RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION); |
| 456 } | 460 } |
| 457 } | 461 } |
| 458 | 462 |
| 459 | 463 |
| 460 void FullCodeGenerator::SetCallPosition(Expression* expr, int argc) { | 464 void FullCodeGenerator::SetCallPosition(Expression* expr, int argc) { |
| 461 if (expr->position() == RelocInfo::kNoPosition) return; | 465 if (expr->position() == RelocInfo::kNoPosition) return; |
| 462 RecordPosition(masm_, expr->position()); | 466 RecordPosition(masm_, expr->position()); |
| 463 if (info_->is_debug()) { | 467 if (info_->is_debug()) { |
| 464 // Always emit a debug break slot before a call. | 468 // Always emit a debug break slot before a call. |
| 465 DebugCodegen::GenerateSlot(masm_, DebugCodegen::DEBUG_BREAK_AT_CALL, argc); | 469 DebugCodegen::GenerateSlot(masm_, RelocInfo::DEBUG_BREAK_SLOT_AT_CALL, |
| 470 argc); |
| 466 } | 471 } |
| 467 } | 472 } |
| 468 | 473 |
| 469 | 474 |
| 470 void FullCodeGenerator::SetConstructCallPosition(Expression* expr) { | 475 void FullCodeGenerator::SetConstructCallPosition(Expression* expr) { |
| 471 if (expr->position() == RelocInfo::kNoPosition) return; | 476 if (expr->position() == RelocInfo::kNoPosition) return; |
| 472 RecordPosition(masm_, expr->position()); | 477 RecordPosition(masm_, expr->position()); |
| 473 if (info_->is_debug()) { | 478 if (info_->is_debug()) { |
| 474 // Always emit a debug break slot before a construct call. | 479 // Always emit a debug break slot before a construct call. |
| 475 DebugCodegen::GenerateSlot(masm_, | 480 DebugCodegen::GenerateSlot(masm_, |
| 476 DebugCodegen::DEBUG_BREAK_AT_CONSTRUCT_CALL); | 481 RelocInfo::DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL); |
| 477 } | 482 } |
| 478 } | 483 } |
| 479 | 484 |
| 480 | 485 |
| 481 void FullCodeGenerator::VisitSuperPropertyReference( | 486 void FullCodeGenerator::VisitSuperPropertyReference( |
| 482 SuperPropertyReference* super) { | 487 SuperPropertyReference* super) { |
| 483 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); | 488 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); |
| 484 } | 489 } |
| 485 | 490 |
| 486 | 491 |
| (...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1482 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
| 1478 codegen_->scope_ = saved_scope_; | 1483 codegen_->scope_ = saved_scope_; |
| 1479 } | 1484 } |
| 1480 | 1485 |
| 1481 | 1486 |
| 1482 #undef __ | 1487 #undef __ |
| 1483 | 1488 |
| 1484 | 1489 |
| 1485 } // namespace internal | 1490 } // namespace internal |
| 1486 } // namespace v8 | 1491 } // namespace v8 |
| OLD | NEW |