| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2207 // Fake TOS for targets that shadowed breaks and continues. | 2207 // Fake TOS for targets that shadowed breaks and continues. |
| 2208 __ mov(r0, Operand(Factory::undefined_value())); | 2208 __ mov(r0, Operand(Factory::undefined_value())); |
| 2209 frame_->EmitPush(r0); | 2209 frame_->EmitPush(r0); |
| 2210 } | 2210 } |
| 2211 __ mov(r2, Operand(Smi::FromInt(JUMPING + i))); | 2211 __ mov(r2, Operand(Smi::FromInt(JUMPING + i))); |
| 2212 unlink.Jump(); | 2212 unlink.Jump(); |
| 2213 } | 2213 } |
| 2214 } | 2214 } |
| 2215 | 2215 |
| 2216 // Unlink from try chain; | 2216 // Unlink from try chain; |
| 2217 unlink.Bind(); | 2217 if (unlink.is_linked()) { |
| 2218 unlink.Bind(); |
| 2219 } |
| 2218 | 2220 |
| 2219 // Preserve TOS result in r0 across stack manipulation. | 2221 // Control can reach here via a jump to unlink or by falling off the |
| 2220 frame_->EmitPop(r0); | 2222 // end of the try block (with no unlinks). |
| 2221 // Reload sp from the top handler, because some statements that we | 2223 if (has_valid_frame()) { |
| 2222 // break from (eg, for...in) may have left stuff on the stack. | 2224 // Preserve TOS result in r0 across stack manipulation. |
| 2223 __ mov(r3, Operand(ExternalReference(Top::k_handler_address))); | 2225 frame_->EmitPop(r0); |
| 2224 __ ldr(sp, MemOperand(r3)); | 2226 // Reload sp from the top handler, because some statements that we |
| 2225 // The stack pointer was restored to just below the code slot | 2227 // break from (eg, for...in) may have left stuff on the stack. |
| 2226 // (the topmost slot) in the handler. | 2228 __ mov(r3, Operand(ExternalReference(Top::k_handler_address))); |
| 2227 frame_->Forget(frame_->height() - handler_height + 1); | 2229 __ ldr(sp, MemOperand(r3)); |
| 2228 const int kNextIndex = (StackHandlerConstants::kNextOffset | 2230 // The stack pointer was restored to just below the code slot (the |
| 2229 + StackHandlerConstants::kAddressDisplacement) | 2231 // topmost slot) in the handler. |
| 2230 / kPointerSize; | 2232 frame_->Forget(frame_->height() - handler_height + 1); |
| 2231 __ ldr(r1, frame_->ElementAt(kNextIndex)); | 2233 const int kNextIndex = (StackHandlerConstants::kNextOffset |
| 2232 __ str(r1, MemOperand(r3)); | 2234 + StackHandlerConstants::kAddressDisplacement) |
| 2233 ASSERT(StackHandlerConstants::kCodeOffset == 0); // first field is code | 2235 / kPointerSize; |
| 2234 // Drop the rest of the handler (not including the already dropped | 2236 __ ldr(r1, frame_->ElementAt(kNextIndex)); |
| 2235 // code slot). | 2237 __ str(r1, MemOperand(r3)); |
| 2236 frame_->Drop(StackHandlerConstants::kSize / kPointerSize - 1); | 2238 ASSERT(StackHandlerConstants::kCodeOffset == 0); |
| 2237 // Restore the result to TOS. | 2239 // Drop the rest of the handler (not including the already dropped |
| 2238 frame_->EmitPush(r0); | 2240 // code slot). |
| 2241 frame_->Drop(StackHandlerConstants::kSize / kPointerSize - 1); |
| 2242 // Restore the result to TOS. |
| 2243 frame_->EmitPush(r0); |
| 2244 } |
| 2239 | 2245 |
| 2240 // --- Finally block --- | 2246 // --- Finally block --- |
| 2241 finally_block.Bind(); | 2247 finally_block.Bind(); |
| 2242 | 2248 |
| 2243 // Push the state on the stack. | 2249 // Push the state on the stack. |
| 2244 frame_->EmitPush(r2); | 2250 frame_->EmitPush(r2); |
| 2245 | 2251 |
| 2246 // We keep two elements on the stack - the (possibly faked) result | 2252 // We keep two elements on the stack - the (possibly faked) result |
| 2247 // and the state - while evaluating the finally block. Record it, so | 2253 // and the state - while evaluating the finally block. Record it, so |
| 2248 // that a break/continue crossing this statement can restore the | 2254 // that a break/continue crossing this statement can restore the |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2681 frame_->CallRuntime(Runtime::kCloneObjectLiteralBoilerplate, 1); | 2687 frame_->CallRuntime(Runtime::kCloneObjectLiteralBoilerplate, 1); |
| 2682 frame_->EmitPush(r0); // save the result | 2688 frame_->EmitPush(r0); // save the result |
| 2683 // r0: cloned object literal | 2689 // r0: cloned object literal |
| 2684 | 2690 |
| 2685 for (int i = 0; i < node->properties()->length(); i++) { | 2691 for (int i = 0; i < node->properties()->length(); i++) { |
| 2686 ObjectLiteral::Property* property = node->properties()->at(i); | 2692 ObjectLiteral::Property* property = node->properties()->at(i); |
| 2687 Literal* key = property->key(); | 2693 Literal* key = property->key(); |
| 2688 Expression* value = property->value(); | 2694 Expression* value = property->value(); |
| 2689 switch (property->kind()) { | 2695 switch (property->kind()) { |
| 2690 case ObjectLiteral::Property::CONSTANT: break; | 2696 case ObjectLiteral::Property::CONSTANT: break; |
| 2697 case ObjectLiteral::Property::OBJECT_LITERAL: |
| 2698 if (property->value()->AsObjectLiteral()->is_simple()) break; |
| 2691 case ObjectLiteral::Property::COMPUTED: // fall through | 2699 case ObjectLiteral::Property::COMPUTED: // fall through |
| 2692 case ObjectLiteral::Property::PROTOTYPE: { | 2700 case ObjectLiteral::Property::PROTOTYPE: { |
| 2693 frame_->EmitPush(r0); // dup the result | 2701 frame_->EmitPush(r0); // dup the result |
| 2694 LoadAndSpill(key); | 2702 LoadAndSpill(key); |
| 2695 LoadAndSpill(value); | 2703 LoadAndSpill(value); |
| 2696 frame_->CallRuntime(Runtime::kSetProperty, 3); | 2704 frame_->CallRuntime(Runtime::kSetProperty, 3); |
| 2697 // restore r0 | 2705 // restore r0 |
| 2698 __ ldr(r0, frame_->Top()); | 2706 __ ldr(r0, frame_->Top()); |
| 2699 break; | 2707 break; |
| 2700 } | 2708 } |
| (...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5078 __ mov(r2, Operand(0)); | 5086 __ mov(r2, Operand(0)); |
| 5079 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 5087 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
| 5080 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 5088 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
| 5081 RelocInfo::CODE_TARGET); | 5089 RelocInfo::CODE_TARGET); |
| 5082 } | 5090 } |
| 5083 | 5091 |
| 5084 | 5092 |
| 5085 #undef __ | 5093 #undef __ |
| 5086 | 5094 |
| 5087 } } // namespace v8::internal | 5095 } } // namespace v8::internal |
| OLD | NEW |