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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Generate code for a JS function. On entry to the function the receiver | 38 // Generate code for a JS function. On entry to the function the receiver |
39 // and arguments have been pushed on the stack left to right, with the | 39 // and arguments have been pushed on the stack left to right, with the |
40 // return address on top of them. The actual argument count matches the | 40 // return address on top of them. The actual argument count matches the |
41 // formal parameter count expected by the function. | 41 // formal parameter count expected by the function. |
42 // | 42 // |
43 // The live registers are: | 43 // The live registers are: |
44 // o edi: the JS function object being called (ie, ourselves) | 44 // o edi: the JS function object being called (ie, ourselves) |
45 // o esi: our context | 45 // o esi: our context |
46 // o ebp: our caller's frame pointer | 46 // o ebp: our caller's frame pointer |
| 47 // o esp: stack pointer (pointing to return address) |
47 // | 48 // |
48 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 49 // The function builds a JS frame. Please see JavaScriptFrameConstants in |
49 // frames-ia32.h for its layout. | 50 // frames-ia32.h for its layout. |
50 void FastCodeGenerator::Generate(FunctionLiteral* fun) { | 51 void FastCodeGenerator::Generate(FunctionLiteral* fun) { |
51 function_ = fun; | 52 function_ = fun; |
52 | 53 |
53 __ push(ebp); // Caller's frame pointer. | 54 __ push(ebp); // Caller's frame pointer. |
54 __ mov(ebp, esp); | 55 __ mov(ebp, esp); |
55 __ push(esi); // Callee's context. | 56 __ push(esi); // Callee's context. |
56 __ push(edi); // Callee's JS Function. | 57 __ push(edi); // Callee's JS Function. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 Visit(expr->value()); | 131 Visit(expr->value()); |
131 | 132 |
132 Variable* var = expr->target()->AsVariableProxy()->AsVariable(); | 133 Variable* var = expr->target()->AsVariableProxy()->AsVariable(); |
133 ASSERT(var != NULL && var->slot() != NULL); | 134 ASSERT(var != NULL && var->slot() != NULL); |
134 __ mov(eax, Operand(esp, 0)); | 135 __ mov(eax, Operand(esp, 0)); |
135 __ mov(Operand(ebp, SlotOffset(var->slot())), eax); | 136 __ mov(Operand(ebp, SlotOffset(var->slot())), eax); |
136 } | 137 } |
137 | 138 |
138 | 139 |
139 } } // namespace v8::internal | 140 } } // namespace v8::internal |
OLD | NEW |