| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Offset is negative because higher indexes are at lower addresses. | 60 // Offset is negative because higher indexes are at lower addresses. |
| 61 int offset = -slot->index() * kPointerSize; | 61 int offset = -slot->index() * kPointerSize; |
| 62 // Adjust by a (parameter or local) base offset. | 62 // Adjust by a (parameter or local) base offset. |
| 63 switch (slot->type()) { | 63 switch (slot->type()) { |
| 64 case Slot::PARAMETER: | 64 case Slot::PARAMETER: |
| 65 offset += (function_->scope()->num_parameters() + 1) * kPointerSize; | 65 offset += (function_->scope()->num_parameters() + 1) * kPointerSize; |
| 66 break; | 66 break; |
| 67 case Slot::LOCAL: | 67 case Slot::LOCAL: |
| 68 offset += JavaScriptFrameConstants::kLocal0Offset; | 68 offset += JavaScriptFrameConstants::kLocal0Offset; |
| 69 break; | 69 break; |
| 70 default: | 70 case Slot::CONTEXT: // Fall through. |
| 71 case Slot::LOOKUP: |
| 71 UNREACHABLE(); | 72 UNREACHABLE(); |
| 72 } | 73 } |
| 73 return offset; | 74 return offset; |
| 74 } | 75 } |
| 75 | 76 |
| 76 | 77 |
| 77 void FastCodeGenerator::VisitDeclarations( | 78 void FastCodeGenerator::VisitDeclarations( |
| 78 ZoneList<Declaration*>* declarations) { | 79 ZoneList<Declaration*>* declarations) { |
| 79 int length = declarations->length(); | 80 int length = declarations->length(); |
| 80 int globals = 0; | 81 int globals = 0; |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 __ Drop(stack_depth); | 748 __ Drop(stack_depth); |
| 748 __ PopTryHandler(); | 749 __ PopTryHandler(); |
| 749 return 0; | 750 return 0; |
| 750 } | 751 } |
| 751 | 752 |
| 752 | 753 |
| 753 #undef __ | 754 #undef __ |
| 754 | 755 |
| 755 | 756 |
| 756 } } // namespace v8::internal | 757 } } // namespace v8::internal |
| OLD | NEW |