OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 } | 244 } |
245 } | 245 } |
246 | 246 |
247 // Store the arguments object. This must happen after context | 247 // Store the arguments object. This must happen after context |
248 // initialization because the arguments object may be stored in | 248 // initialization because the arguments object may be stored in |
249 // the context. | 249 // the context. |
250 if (ArgumentsMode() != NO_ARGUMENTS_ALLOCATION) { | 250 if (ArgumentsMode() != NO_ARGUMENTS_ALLOCATION) { |
251 StoreArgumentsObject(true); | 251 StoreArgumentsObject(true); |
252 } | 252 } |
253 | 253 |
| 254 // Initialize ThisFunction reference if present. |
| 255 if (scope_->is_function_scope() && scope_->function() != NULL) { |
| 256 frame_->Push(Factory::the_hole_value()); |
| 257 StoreToSlot(scope_->function()->slot(), NOT_CONST_INIT); |
| 258 } |
| 259 |
254 // Generate code to 'execute' declarations and initialize functions | 260 // Generate code to 'execute' declarations and initialize functions |
255 // (source elements). In case of an illegal redeclaration we need to | 261 // (source elements). In case of an illegal redeclaration we need to |
256 // handle that instead of processing the declarations. | 262 // handle that instead of processing the declarations. |
257 if (scope_->HasIllegalRedeclaration()) { | 263 if (scope_->HasIllegalRedeclaration()) { |
258 Comment cmnt(masm_, "[ illegal redeclarations"); | 264 Comment cmnt(masm_, "[ illegal redeclarations"); |
259 scope_->VisitIllegalRedeclaration(this); | 265 scope_->VisitIllegalRedeclaration(this); |
260 } else { | 266 } else { |
261 Comment cmnt(masm_, "[ declarations"); | 267 Comment cmnt(masm_, "[ declarations"); |
262 ProcessDeclarations(scope_->declarations()); | 268 ProcessDeclarations(scope_->declarations()); |
263 // Bail out if a stack-overflow exception occurred when processing | 269 // Bail out if a stack-overflow exception occurred when processing |
(...skipping 9498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9762 | 9768 |
9763 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 9769 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
9764 // tagged as a small integer. | 9770 // tagged as a small integer. |
9765 __ bind(&runtime); | 9771 __ bind(&runtime); |
9766 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); | 9772 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); |
9767 } | 9773 } |
9768 | 9774 |
9769 #undef __ | 9775 #undef __ |
9770 | 9776 |
9771 } } // namespace v8::internal | 9777 } } // namespace v8::internal |
OLD | NEW |