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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 __ mov(r3, Operand(slot_offset)); | 240 __ mov(r3, Operand(slot_offset)); |
241 __ RecordWrite(r2, r3, r1); | 241 __ RecordWrite(r2, r3, r1); |
242 } | 242 } |
243 } | 243 } |
244 } | 244 } |
245 | 245 |
246 // Store the arguments object. This must happen after context | 246 // Store the arguments object. This must happen after context |
247 // initialization because the arguments object may be stored in the | 247 // initialization because the arguments object may be stored in the |
248 // context. | 248 // context. |
249 if (scope_->arguments() != NULL) { | 249 if (scope_->arguments() != NULL) { |
| 250 Comment cmnt(masm_, "[ allocate arguments object"); |
250 ASSERT(scope_->arguments_shadow() != NULL); | 251 ASSERT(scope_->arguments_shadow() != NULL); |
251 Comment cmnt(masm_, "[ allocate arguments object"); | 252 Variable* arguments = scope_->arguments()->var(); |
252 { Reference shadow_ref(this, scope_->arguments_shadow()); | 253 Variable* shadow = scope_->arguments_shadow()->var(); |
253 { Reference arguments_ref(this, scope_->arguments()); | 254 ASSERT(arguments != NULL && arguments->slot() != NULL); |
254 ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT); | 255 ASSERT(shadow != NULL && shadow->slot() != NULL); |
255 __ ldr(r2, frame_->Function()); | 256 ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT); |
256 // The receiver is below the arguments, the return address, | 257 __ ldr(r2, frame_->Function()); |
257 // and the frame pointer on the stack. | 258 // The receiver is below the arguments, the return address, and the |
258 const int kReceiverDisplacement = 2 + scope_->num_parameters(); | 259 // frame pointer on the stack. |
259 __ add(r1, fp, Operand(kReceiverDisplacement * kPointerSize)); | 260 const int kReceiverDisplacement = 2 + scope_->num_parameters(); |
260 __ mov(r0, Operand(Smi::FromInt(scope_->num_parameters()))); | 261 __ add(r1, fp, Operand(kReceiverDisplacement * kPointerSize)); |
261 frame_->Adjust(3); | 262 __ mov(r0, Operand(Smi::FromInt(scope_->num_parameters()))); |
262 __ stm(db_w, sp, r0.bit() | r1.bit() | r2.bit()); | 263 frame_->Adjust(3); |
263 frame_->CallStub(&stub, 3); | 264 __ stm(db_w, sp, r0.bit() | r1.bit() | r2.bit()); |
264 frame_->EmitPush(r0); | 265 frame_->CallStub(&stub, 3); |
265 arguments_ref.SetValue(NOT_CONST_INIT); | 266 frame_->EmitPush(r0); |
266 } | 267 StoreToSlot(arguments->slot(), NOT_CONST_INIT); |
267 shadow_ref.SetValue(NOT_CONST_INIT); | 268 StoreToSlot(shadow->slot(), NOT_CONST_INIT); |
268 } | |
269 frame_->Drop(); // Value is no longer needed. | 269 frame_->Drop(); // Value is no longer needed. |
270 } | 270 } |
271 | 271 |
272 // Initialize ThisFunction reference if present. | 272 // Initialize ThisFunction reference if present. |
273 if (scope_->is_function_scope() && scope_->function() != NULL) { | 273 if (scope_->is_function_scope() && scope_->function() != NULL) { |
274 __ mov(ip, Operand(Factory::the_hole_value())); | 274 __ mov(ip, Operand(Factory::the_hole_value())); |
275 frame_->EmitPush(ip); | 275 frame_->EmitPush(ip); |
276 StoreToSlot(scope_->function()->slot(), NOT_CONST_INIT); | 276 StoreToSlot(scope_->function()->slot(), NOT_CONST_INIT); |
277 } | 277 } |
278 | 278 |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1985 CodeForStatementPosition(node); | 1985 CodeForStatementPosition(node); |
1986 | 1986 |
1987 JumpTarget try_block; | 1987 JumpTarget try_block; |
1988 JumpTarget exit; | 1988 JumpTarget exit; |
1989 | 1989 |
1990 try_block.Call(); | 1990 try_block.Call(); |
1991 // --- Catch block --- | 1991 // --- Catch block --- |
1992 frame_->EmitPush(r0); | 1992 frame_->EmitPush(r0); |
1993 | 1993 |
1994 // Store the caught exception in the catch variable. | 1994 // Store the caught exception in the catch variable. |
1995 { Reference ref(this, node->catch_var()); | 1995 Variable* catch_var = node->catch_var()->var(); |
1996 ASSERT(ref.is_slot()); | 1996 ASSERT(catch_var != NULL && catch_var->slot() != NULL); |
1997 // Here we make use of the convenient property that it doesn't matter | 1997 StoreToSlot(catch_var->slot(), NOT_CONST_INIT); |
1998 // whether a value is immediately on top of or underneath a zero-sized | |
1999 // reference. | |
2000 ref.SetValue(NOT_CONST_INIT); | |
2001 } | |
2002 | 1998 |
2003 // Remove the exception from the stack. | 1999 // Remove the exception from the stack. |
2004 frame_->Drop(); | 2000 frame_->Drop(); |
2005 | 2001 |
2006 VisitStatementsAndSpill(node->catch_block()->statements()); | 2002 VisitStatementsAndSpill(node->catch_block()->statements()); |
2007 if (frame_ != NULL) { | 2003 if (frame_ != NULL) { |
2008 exit.Jump(); | 2004 exit.Jump(); |
2009 } | 2005 } |
2010 | 2006 |
2011 | 2007 |
(...skipping 4665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6677 ASSERT((static_cast<unsigned>(cc_) >> 26) < (1 << 16)); | 6673 ASSERT((static_cast<unsigned>(cc_) >> 26) < (1 << 16)); |
6678 int nnn_value = (never_nan_nan_ ? 2 : 0); | 6674 int nnn_value = (never_nan_nan_ ? 2 : 0); |
6679 if (cc_ != eq) nnn_value = 0; // Avoid duplicate stubs. | 6675 if (cc_ != eq) nnn_value = 0; // Avoid duplicate stubs. |
6680 return (static_cast<unsigned>(cc_) >> 26) | nnn_value | (strict_ ? 1 : 0); | 6676 return (static_cast<unsigned>(cc_) >> 26) | nnn_value | (strict_ ? 1 : 0); |
6681 } | 6677 } |
6682 | 6678 |
6683 | 6679 |
6684 #undef __ | 6680 #undef __ |
6685 | 6681 |
6686 } } // namespace v8::internal | 6682 } } // namespace v8::internal |
OLD | NEW |