| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 void FastCodeGenerator::Generate(FunctionLiteral* fun, CompilationInfo* info) { | 105 void FastCodeGenerator::Generate(FunctionLiteral* fun, CompilationInfo* info) { |
| 106 ASSERT(function_ == NULL); | 106 ASSERT(function_ == NULL); |
| 107 ASSERT(info_ == NULL); | 107 ASSERT(info_ == NULL); |
| 108 function_ = fun; | 108 function_ = fun; |
| 109 info_ = info; | 109 info_ = info; |
| 110 | 110 |
| 111 // Save the caller's frame pointer and set up our own. | 111 // Save the caller's frame pointer and set up our own. |
| 112 Comment prologue_cmnt(masm(), ";; Prologue"); | 112 Comment prologue_cmnt(masm(), ";; Prologue"); |
| 113 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 113 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 114 __ add(fp, sp, Operand(2 * kPointerSize)); |
| 114 // Note that we keep a live register reference to cp (context) at | 115 // Note that we keep a live register reference to cp (context) at |
| 115 // this point. | 116 // this point. |
| 116 | 117 |
| 117 // Receiver (this) is allocated to r1 if there are this properties. | 118 // Receiver (this) is allocated to r1 if there are this properties. |
| 118 if (has_this_properties()) EmitReceiverMapCheck(); | 119 if (has_this_properties()) EmitReceiverMapCheck(); |
| 119 | 120 |
| 120 VisitStatements(fun->body()); | 121 VisitStatements(fun->body()); |
| 121 | 122 |
| 122 Comment return_cmnt(masm(), ";; Return(<undefined>)"); | 123 Comment return_cmnt(masm(), ";; Return(<undefined>)"); |
| 123 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 124 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
| 124 | 125 |
| 125 Comment epilogue_cmnt(masm(), ";; Epilogue"); | 126 Comment epilogue_cmnt(masm(), ";; Epilogue"); |
| 126 __ mov(sp, fp); | 127 __ mov(sp, fp); |
| 127 __ ldm(ia_w, sp, fp.bit() | lr.bit()); | 128 __ ldm(ia_w, sp, fp.bit() | lr.bit()); |
| 128 int32_t sp_delta = (fun->scope()->num_parameters() + 1) * kPointerSize; | 129 int32_t sp_delta = (fun->scope()->num_parameters() + 1) * kPointerSize; |
| 129 __ add(sp, sp, Operand(sp_delta)); | 130 __ add(sp, sp, Operand(sp_delta)); |
| 130 __ Jump(lr); | 131 __ Jump(lr); |
| 131 | 132 |
| 132 __ bind(&bailout_); | 133 __ bind(&bailout_); |
| 133 } | 134 } |
| 134 | 135 |
| 135 | 136 |
| 136 #undef __ | 137 #undef __ |
| 137 | 138 |
| 138 | 139 |
| 139 } } // namespace v8::internal | 140 } } // namespace v8::internal |
| OLD | NEW |