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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 RecordStatementPosition(masm_, fun->end_position() - 1); | 431 RecordStatementPosition(masm_, fun->end_position() - 1); |
432 } | 432 } |
433 | 433 |
434 | 434 |
435 void FullCodeGenerator::SetStatementPosition( | 435 void FullCodeGenerator::SetStatementPosition( |
436 Statement* stmt, FullCodeGenerator::InsertBreak insert_break) { | 436 Statement* stmt, FullCodeGenerator::InsertBreak insert_break) { |
437 if (stmt->position() == RelocInfo::kNoPosition) return; | 437 if (stmt->position() == RelocInfo::kNoPosition) return; |
438 bool recorded = RecordStatementPosition(masm_, stmt->position()); | 438 bool recorded = RecordStatementPosition(masm_, stmt->position()); |
439 if (recorded && insert_break == INSERT_BREAK && info_->is_debug() && | 439 if (recorded && insert_break == INSERT_BREAK && info_->is_debug() && |
440 !stmt->IsDebuggerStatement()) { | 440 !stmt->IsDebuggerStatement()) { |
| 441 masm_->RecordDebugBreakSlot(); |
441 DebugCodegen::GenerateSlot(masm_); | 442 DebugCodegen::GenerateSlot(masm_); |
442 } | 443 } |
443 } | 444 } |
444 | 445 |
445 | 446 |
446 void FullCodeGenerator::SetExpressionPosition( | 447 void FullCodeGenerator::SetExpressionPosition( |
447 Expression* expr, FullCodeGenerator::InsertBreak insert_break) { | 448 Expression* expr, FullCodeGenerator::InsertBreak insert_break) { |
448 if (expr->position() == RelocInfo::kNoPosition) return; | 449 if (expr->position() == RelocInfo::kNoPosition) return; |
449 bool recorded = RecordPosition(masm_, expr->position()); | 450 bool recorded = RecordPosition(masm_, expr->position()); |
450 if (recorded && insert_break == INSERT_BREAK && info_->is_debug()) { | 451 if (recorded && insert_break == INSERT_BREAK && info_->is_debug()) { |
| 452 masm_->RecordDebugBreakSlot(); |
451 DebugCodegen::GenerateSlot(masm_); | 453 DebugCodegen::GenerateSlot(masm_); |
452 } | 454 } |
453 } | 455 } |
454 | 456 |
455 | 457 |
456 void FullCodeGenerator::SetExpressionAsStatementPosition(Expression* expr) { | 458 void FullCodeGenerator::SetExpressionAsStatementPosition(Expression* expr) { |
457 if (expr->position() == RelocInfo::kNoPosition) return; | 459 if (expr->position() == RelocInfo::kNoPosition) return; |
458 bool recorded = RecordStatementPosition(masm_, expr->position()); | 460 bool recorded = RecordStatementPosition(masm_, expr->position()); |
459 if (recorded && info_->is_debug()) DebugCodegen::GenerateSlot(masm_); | 461 if (recorded && info_->is_debug()) { |
| 462 masm_->RecordDebugBreakSlot(); |
| 463 DebugCodegen::GenerateSlot(masm_); |
| 464 } |
460 } | 465 } |
461 | 466 |
462 | 467 |
| 468 void FullCodeGenerator::SetCallPosition(Expression* expr, int argc) { |
| 469 if (expr->position() == RelocInfo::kNoPosition) return; |
| 470 RecordPosition(masm_, expr->position()); |
| 471 if (info_->is_debug()) { |
| 472 // Always emit a debug break slot for a call. |
| 473 masm_->RecordDebugBreakSlotForCall(argc); |
| 474 DebugCodegen::GenerateSlot(masm_); |
| 475 } |
| 476 } |
| 477 |
| 478 |
463 void FullCodeGenerator::VisitSuperPropertyReference( | 479 void FullCodeGenerator::VisitSuperPropertyReference( |
464 SuperPropertyReference* super) { | 480 SuperPropertyReference* super) { |
465 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); | 481 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); |
466 } | 482 } |
467 | 483 |
468 | 484 |
469 void FullCodeGenerator::VisitSuperCallReference(SuperCallReference* super) { | 485 void FullCodeGenerator::VisitSuperCallReference(SuperCallReference* super) { |
470 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); | 486 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); |
471 } | 487 } |
472 | 488 |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1450 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1435 codegen_->scope_ = saved_scope_; | 1451 codegen_->scope_ = saved_scope_; |
1436 } | 1452 } |
1437 | 1453 |
1438 | 1454 |
1439 #undef __ | 1455 #undef __ |
1440 | 1456 |
1441 | 1457 |
1442 } // namespace internal | 1458 } // namespace internal |
1443 } // namespace v8 | 1459 } // namespace v8 |
OLD | NEW |