OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 position_(masm_->current_position()) { | 46 position_(masm_->current_position()) { |
47 generator->AddDeferred(this); | 47 generator->AddDeferred(this); |
48 ASSERT(statement_position_ != RelocInfo::kNoPosition); | 48 ASSERT(statement_position_ != RelocInfo::kNoPosition); |
49 ASSERT(position_ != RelocInfo::kNoPosition); | 49 ASSERT(position_ != RelocInfo::kNoPosition); |
50 #ifdef DEBUG | 50 #ifdef DEBUG |
51 comment_ = ""; | 51 comment_ = ""; |
52 #endif | 52 #endif |
53 } | 53 } |
54 | 54 |
55 | 55 |
| 56 void CodeGenerator::ClearDeferred() { |
| 57 for (int i = 0; i < deferred_.length(); i++) { |
| 58 deferred_[i]->Clear(); |
| 59 } |
| 60 } |
| 61 |
| 62 |
56 void CodeGenerator::ProcessDeferred() { | 63 void CodeGenerator::ProcessDeferred() { |
57 while (!deferred_.is_empty()) { | 64 while (!deferred_.is_empty()) { |
58 DeferredCode* code = deferred_.RemoveLast(); | 65 DeferredCode* code = deferred_.RemoveLast(); |
59 MacroAssembler* masm = code->masm(); | 66 MacroAssembler* masm = code->masm(); |
60 // Record position of deferred code stub. | 67 // Record position of deferred code stub. |
61 masm->RecordStatementPosition(code->statement_position()); | 68 masm->RecordStatementPosition(code->statement_position()); |
62 if (code->position() != RelocInfo::kNoPosition) { | 69 if (code->position() != RelocInfo::kNoPosition) { |
63 masm->RecordPosition(code->position()); | 70 masm->RecordPosition(code->position()); |
64 } | 71 } |
65 // Generate the code. | 72 // Generate the code. |
66 Comment cmnt(masm, code->comment()); | 73 Comment cmnt(masm, code->comment()); |
67 code->Generate(); | 74 code->Generate(); |
68 ASSERT(code->enter()->is_bound()); | 75 ASSERT(code->enter()->is_bound()); |
| 76 code->Clear(); |
69 } | 77 } |
70 } | 78 } |
71 | 79 |
72 | 80 |
73 void CodeGenerator::SetFrame(VirtualFrame* new_frame, | 81 void CodeGenerator::SetFrame(VirtualFrame* new_frame, |
74 RegisterFile* non_frame_registers) { | 82 RegisterFile* non_frame_registers) { |
75 RegisterFile saved_counts; | 83 RegisterFile saved_counts; |
76 if (has_valid_frame()) { | 84 if (has_valid_frame()) { |
77 frame_->DetachFromCodeGenerator(); | 85 frame_->DetachFromCodeGenerator(); |
78 // The remaining register reference counts are the non-frame ones. | 86 // The remaining register reference counts are the non-frame ones. |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { | 585 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { |
578 switch (type_) { | 586 switch (type_) { |
579 case READ_LENGTH: GenerateReadLength(masm); break; | 587 case READ_LENGTH: GenerateReadLength(masm); break; |
580 case READ_ELEMENT: GenerateReadElement(masm); break; | 588 case READ_ELEMENT: GenerateReadElement(masm); break; |
581 case NEW_OBJECT: GenerateNewObject(masm); break; | 589 case NEW_OBJECT: GenerateNewObject(masm); break; |
582 } | 590 } |
583 } | 591 } |
584 | 592 |
585 | 593 |
586 } } // namespace v8::internal | 594 } } // namespace v8::internal |
OLD | NEW |