Chromium Code Reviews| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 // patch with the code required by the debugger. | 122 // patch with the code required by the debugger. |
| 123 __ mov(esp, ebp); | 123 __ mov(esp, ebp); |
| 124 __ pop(ebp); | 124 __ pop(ebp); |
| 125 __ ret((function_->scope()->num_parameters() + 1) * kPointerSize); | 125 __ ret((function_->scope()->num_parameters() + 1) * kPointerSize); |
| 126 } | 126 } |
| 127 | 127 |
| 128 | 128 |
| 129 void FastCodeGenerator::VisitVariableProxy(VariableProxy* expr) { | 129 void FastCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
| 130 Comment cmnt(masm_, "[ VariableProxy"); | 130 Comment cmnt(masm_, "[ VariableProxy"); |
| 131 Expression* rewrite = expr->var()->rewrite(); | 131 Expression* rewrite = expr->var()->rewrite(); |
| 132 ASSERT(rewrite != NULL); | 132 if (rewrite == NULL) { |
|
fschneider
2009/10/20 14:16:17
Insert a comment here like:
Comment cmnt(masm_, "
| |
| 133 // Reference to a global variable, use inline caching. Variable | |
| 134 // name is passed in ecx and the global object on the stack. | |
| 135 __ push(CodeGenerator::GlobalObject()); | |
| 136 __ mov(ecx, expr->name()); | |
| 137 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); | |
| 138 __ call(ic, RelocInfo::CODE_TARGET_CONTEXT); | |
| 133 | 139 |
| 134 Slot* slot = rewrite->AsSlot(); | 140 // A test eax instruction following the call is used by the IC to |
| 135 ASSERT(slot != NULL); | 141 // indicate that the inobject property case was inlined. Ensure there |
| 136 { Comment cmnt(masm_, "[ Slot"); | 142 // is no test eax instruction here. Remember that the assembler may |
| 143 // choose to do peephole optimization (eg, push/pop elimination). | |
| 144 if (expr->location().is_temporary()) { | |
| 145 // Replace the global object with the result. | |
| 146 __ mov(Operand(esp, 0), eax); | |
| 147 } else { | |
| 148 ASSERT(expr->location().is_nowhere()); | |
| 149 __ pop(eax); | |
| 150 } | |
| 151 | |
| 152 } else { | |
| 153 // Reference to a local or parameter slot. | |
| 154 Comment cmnt(masm_, "[ Slot"); | |
| 155 Slot* slot = rewrite->AsSlot(); | |
| 156 ASSERT(slot != NULL); | |
| 137 if (expr->location().is_temporary()) { | 157 if (expr->location().is_temporary()) { |
| 138 __ push(Operand(ebp, SlotOffset(slot))); | 158 __ push(Operand(ebp, SlotOffset(slot))); |
| 139 } else { | 159 } else { |
| 140 ASSERT(expr->location().is_nowhere()); | 160 ASSERT(expr->location().is_nowhere()); |
| 141 } | 161 } |
| 142 } | 162 } |
| 143 } | 163 } |
| 144 | 164 |
| 145 | 165 |
| 146 void FastCodeGenerator::VisitAssignment(Assignment* expr) { | 166 void FastCodeGenerator::VisitAssignment(Assignment* expr) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 if (destination.is_temporary()) { | 227 if (destination.is_temporary()) { |
| 208 // Case 'temp <- (var = constant)'. Save result. | 228 // Case 'temp <- (var = constant)'. Save result. |
| 209 __ push(eax); | 229 __ push(eax); |
| 210 } | 230 } |
| 211 } | 231 } |
| 212 } | 232 } |
| 213 } | 233 } |
| 214 | 234 |
| 215 | 235 |
| 216 } } // namespace v8::internal | 236 } } // namespace v8::internal |
| OLD | NEW |