| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 function_ = fun; | 55 function_ = fun; |
| 56 SetFunctionPosition(fun); | 56 SetFunctionPosition(fun); |
| 57 | 57 |
| 58 __ push(ebp); // Caller's frame pointer. | 58 __ push(ebp); // Caller's frame pointer. |
| 59 __ mov(ebp, esp); | 59 __ mov(ebp, esp); |
| 60 __ push(esi); // Callee's context. | 60 __ push(esi); // Callee's context. |
| 61 __ push(edi); // Callee's JS Function. | 61 __ push(edi); // Callee's JS Function. |
| 62 | 62 |
| 63 { Comment cmnt(masm_, "[ Allocate locals"); | 63 { Comment cmnt(masm_, "[ Allocate locals"); |
| 64 int locals_count = fun->scope()->num_stack_slots(); | 64 int locals_count = fun->scope()->num_stack_slots(); |
| 65 for (int i = 0; i < locals_count; i++) { | 65 if (locals_count == 1) { |
| 66 __ push(Immediate(Factory::undefined_value())); | 66 __ push(Immediate(Factory::undefined_value())); |
| 67 } else if (locals_count > 1) { |
| 68 __ mov(eax, Immediate(Factory::undefined_value())); |
| 69 for (int i = 0; i < locals_count; i++) { |
| 70 __ push(eax); |
| 71 } |
| 67 } | 72 } |
| 68 } | 73 } |
| 69 | 74 |
| 70 bool function_in_register = true; | 75 bool function_in_register = true; |
| 71 | 76 |
| 72 Variable* arguments = fun->scope()->arguments()->AsVariable(); | 77 Variable* arguments = fun->scope()->arguments()->AsVariable(); |
| 73 if (arguments != NULL) { | 78 if (arguments != NULL) { |
| 74 // Function uses arguments object. | 79 // Function uses arguments object. |
| 75 Comment cmnt(masm_, "[ Allocate arguments object"); | 80 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 76 __ push(edi); | 81 __ push(edi); |
| (...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 true_label_ = saved_true; | 1545 true_label_ = saved_true; |
| 1541 false_label_ = saved_false; | 1546 false_label_ = saved_false; |
| 1542 // Convert current context to test context: End post-test code. | 1547 // Convert current context to test context: End post-test code. |
| 1543 } | 1548 } |
| 1544 | 1549 |
| 1545 | 1550 |
| 1546 #undef __ | 1551 #undef __ |
| 1547 | 1552 |
| 1548 | 1553 |
| 1549 } } // namespace v8::internal | 1554 } } // namespace v8::internal |
| OLD | NEW |