| 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 2745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2756 CodeForStatement(node); | 2756 CodeForStatement(node); |
| 2757 | 2757 |
| 2758 Reference target(this, node->target()); | 2758 Reference target(this, node->target()); |
| 2759 if (target.is_illegal()) return; | 2759 if (target.is_illegal()) return; |
| 2760 | 2760 |
| 2761 if (node->starts_initialization_block()) { | 2761 if (node->starts_initialization_block()) { |
| 2762 ASSERT(target.type() == Reference::NAMED || | 2762 ASSERT(target.type() == Reference::NAMED || |
| 2763 target.type() == Reference::KEYED); | 2763 target.type() == Reference::KEYED); |
| 2764 // Change to slow case in the beginning of an initialization block | 2764 // Change to slow case in the beginning of an initialization block |
| 2765 // to avoid the quadratic behavior of repeatedly adding fast properties. | 2765 // to avoid the quadratic behavior of repeatedly adding fast properties. |
| 2766 int stack_position = (target.type() == Reference::NAMED) ? 0 : 1; | 2766 int index = (target.type() == Reference::NAMED) ? 0 : 1; |
| 2767 frame_->Push(Operand(esp, stack_position * kPointerSize)); | 2767 frame_->Push(frame_->Element(index)); |
| 2768 __ CallRuntime(Runtime::kToSlowProperties, 1); | 2768 __ CallRuntime(Runtime::kToSlowProperties, 1); |
| 2769 } | 2769 } |
| 2770 if (node->op() == Token::ASSIGN || | 2770 if (node->op() == Token::ASSIGN || |
| 2771 node->op() == Token::INIT_VAR || | 2771 node->op() == Token::INIT_VAR || |
| 2772 node->op() == Token::INIT_CONST) { | 2772 node->op() == Token::INIT_CONST) { |
| 2773 Load(node->value()); | 2773 Load(node->value()); |
| 2774 | 2774 |
| 2775 } else { | 2775 } else { |
| 2776 target.GetValue(NOT_INSIDE_TYPEOF); | 2776 target.GetValue(NOT_INSIDE_TYPEOF); |
| 2777 Literal* literal = node->value()->AsLiteral(); | 2777 Literal* literal = node->value()->AsLiteral(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2795 // Dynamic constant initializations must use the function context | 2795 // Dynamic constant initializations must use the function context |
| 2796 // and initialize the actual constant declared. Dynamic variable | 2796 // and initialize the actual constant declared. Dynamic variable |
| 2797 // initializations are simply assignments and use SetValue. | 2797 // initializations are simply assignments and use SetValue. |
| 2798 target.SetValue(CONST_INIT); | 2798 target.SetValue(CONST_INIT); |
| 2799 } else { | 2799 } else { |
| 2800 target.SetValue(NOT_CONST_INIT); | 2800 target.SetValue(NOT_CONST_INIT); |
| 2801 if (node->ends_initialization_block()) { | 2801 if (node->ends_initialization_block()) { |
| 2802 ASSERT(target.type() == Reference::NAMED || | 2802 ASSERT(target.type() == Reference::NAMED || |
| 2803 target.type() == Reference::KEYED); | 2803 target.type() == Reference::KEYED); |
| 2804 // End of initialization block. Revert to fast case. | 2804 // End of initialization block. Revert to fast case. |
| 2805 int stack_position = (target.type() == Reference::NAMED) ? 1 : 2; | 2805 int index = (target.type() == Reference::NAMED) ? 1 : 2; |
| 2806 frame_->Push(Operand(esp, stack_position * kPointerSize)); | 2806 frame_->Push(frame_->Element(index)); |
| 2807 __ CallRuntime(Runtime::kToFastProperties, 1); | 2807 __ CallRuntime(Runtime::kToFastProperties, 1); |
| 2808 } | 2808 } |
| 2809 } | 2809 } |
| 2810 } | 2810 } |
| 2811 } | 2811 } |
| 2812 | 2812 |
| 2813 | 2813 |
| 2814 void CodeGenerator::VisitThrow(Throw* node) { | 2814 void CodeGenerator::VisitThrow(Throw* node) { |
| 2815 Comment cmnt(masm_, "[ Throw"); | 2815 Comment cmnt(masm_, "[ Throw"); |
| 2816 CodeForStatement(node); | 2816 CodeForStatement(node); |
| (...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5489 | 5489 |
| 5490 // Slow-case: Go through the JavaScript implementation. | 5490 // Slow-case: Go through the JavaScript implementation. |
| 5491 __ bind(&slow); | 5491 __ bind(&slow); |
| 5492 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 5492 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
| 5493 } | 5493 } |
| 5494 | 5494 |
| 5495 | 5495 |
| 5496 #undef __ | 5496 #undef __ |
| 5497 | 5497 |
| 5498 } } // namespace v8::internal | 5498 } } // namespace v8::internal |
| OLD | NEW |