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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 RecordStatementPosition(masm_, fun->end_position() - 1); | 426 RecordStatementPosition(masm_, fun->end_position() - 1); |
427 } | 427 } |
428 | 428 |
429 | 429 |
430 void FullCodeGenerator::SetStatementPosition( | 430 void FullCodeGenerator::SetStatementPosition( |
431 Statement* stmt, FullCodeGenerator::InsertBreak insert_break) { | 431 Statement* stmt, FullCodeGenerator::InsertBreak insert_break) { |
432 if (stmt->position() == RelocInfo::kNoPosition) return; | 432 if (stmt->position() == RelocInfo::kNoPosition) return; |
433 bool recorded = RecordStatementPosition(masm_, stmt->position()); | 433 bool recorded = RecordStatementPosition(masm_, stmt->position()); |
434 if (recorded && insert_break == INSERT_BREAK && info_->is_debug() && | 434 if (recorded && insert_break == INSERT_BREAK && info_->is_debug() && |
435 !stmt->IsDebuggerStatement()) { | 435 !stmt->IsDebuggerStatement()) { |
| 436 masm_->RecordDebugBreakSlot(); |
436 DebugCodegen::GenerateSlot(masm_); | 437 DebugCodegen::GenerateSlot(masm_); |
437 } | 438 } |
438 } | 439 } |
439 | 440 |
440 | 441 |
441 void FullCodeGenerator::SetExpressionPosition( | 442 void FullCodeGenerator::SetExpressionPosition( |
442 Expression* expr, FullCodeGenerator::InsertBreak insert_break) { | 443 Expression* expr, FullCodeGenerator::InsertBreak insert_break) { |
443 if (expr->position() == RelocInfo::kNoPosition) return; | 444 if (expr->position() == RelocInfo::kNoPosition) return; |
444 bool recorded = RecordPosition(masm_, expr->position()); | 445 bool recorded = RecordPosition(masm_, expr->position()); |
445 if (recorded && insert_break == INSERT_BREAK && info_->is_debug()) { | 446 if (recorded && insert_break == INSERT_BREAK && info_->is_debug()) { |
| 447 masm_->RecordDebugBreakSlot(); |
446 DebugCodegen::GenerateSlot(masm_); | 448 DebugCodegen::GenerateSlot(masm_); |
447 } | 449 } |
448 } | 450 } |
449 | 451 |
450 | 452 |
451 void FullCodeGenerator::SetExpressionAsStatementPosition(Expression* expr) { | 453 void FullCodeGenerator::SetExpressionAsStatementPosition(Expression* expr) { |
452 if (expr->position() == RelocInfo::kNoPosition) return; | 454 if (expr->position() == RelocInfo::kNoPosition) return; |
453 bool recorded = RecordStatementPosition(masm_, expr->position()); | 455 bool recorded = RecordStatementPosition(masm_, expr->position()); |
454 if (recorded && info_->is_debug()) DebugCodegen::GenerateSlot(masm_); | 456 if (recorded && info_->is_debug()) { |
| 457 masm_->RecordDebugBreakSlot(); |
| 458 DebugCodegen::GenerateSlot(masm_); |
| 459 } |
455 } | 460 } |
456 | 461 |
457 | 462 |
| 463 void FullCodeGenerator::SetCallPosition(Expression* expr, int argc) { |
| 464 if (expr->position() == RelocInfo::kNoPosition) return; |
| 465 RecordPosition(masm_, expr->position()); |
| 466 if (info_->is_debug()) { |
| 467 // Always emit a debug break slot before a call. |
| 468 masm_->RecordDebugBreakSlotForCall(argc); |
| 469 DebugCodegen::GenerateSlot(masm_); |
| 470 } |
| 471 } |
| 472 |
| 473 |
| 474 void FullCodeGenerator::SetConstructCallPosition(Expression* expr) { |
| 475 if (expr->position() == RelocInfo::kNoPosition) return; |
| 476 RecordPosition(masm_, expr->position()); |
| 477 if (info_->is_debug()) { |
| 478 // Always emit a debug break slot before a construct call. |
| 479 masm_->RecordDebugBreakSlotForConstructCall(); |
| 480 DebugCodegen::GenerateSlot(masm_); |
| 481 } |
| 482 } |
| 483 |
| 484 |
458 void FullCodeGenerator::VisitSuperPropertyReference( | 485 void FullCodeGenerator::VisitSuperPropertyReference( |
459 SuperPropertyReference* super) { | 486 SuperPropertyReference* super) { |
460 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); | 487 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); |
461 } | 488 } |
462 | 489 |
463 | 490 |
464 void FullCodeGenerator::VisitSuperCallReference(SuperCallReference* super) { | 491 void FullCodeGenerator::VisitSuperCallReference(SuperCallReference* super) { |
465 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); | 492 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0); |
466 } | 493 } |
467 | 494 |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1472 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1446 codegen_->scope_ = saved_scope_; | 1473 codegen_->scope_ = saved_scope_; |
1447 } | 1474 } |
1448 | 1475 |
1449 | 1476 |
1450 #undef __ | 1477 #undef __ |
1451 | 1478 |
1452 | 1479 |
1453 } // namespace internal | 1480 } // namespace internal |
1454 } // namespace v8 | 1481 } // namespace v8 |
OLD | NEW |