OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 ASSERT(var != NULL); | 1708 ASSERT(var != NULL); |
1709 ASSERT(var->is_global() || var->AsSlot() != NULL); | 1709 ASSERT(var->is_global() || var->AsSlot() != NULL); |
1710 | 1710 |
1711 if (var->is_global()) { | 1711 if (var->is_global()) { |
1712 ASSERT(!var->is_this()); | 1712 ASSERT(!var->is_this()); |
1713 // Assignment to a global variable. Use inline caching for the | 1713 // Assignment to a global variable. Use inline caching for the |
1714 // assignment. Right-hand-side value is passed in rax, variable name in | 1714 // assignment. Right-hand-side value is passed in rax, variable name in |
1715 // rcx, and the global object on the stack. | 1715 // rcx, and the global object on the stack. |
1716 __ Move(rcx, var->name()); | 1716 __ Move(rcx, var->name()); |
1717 __ movq(rdx, GlobalObjectOperand()); | 1717 __ movq(rdx, GlobalObjectOperand()); |
1718 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); | 1718 Handle<Code> ic(Builtins::builtin(is_strict() |
1719 EmitCallIC(ic, RelocInfo::CODE_TARGET); | 1719 ? Builtins::StoreIC_Initialize_Strict |
| 1720 : Builtins::StoreIC_Initialize)); |
| 1721 EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT); |
1720 | 1722 |
1721 } else if (var->mode() != Variable::CONST || op == Token::INIT_CONST) { | 1723 } else if (var->mode() != Variable::CONST || op == Token::INIT_CONST) { |
1722 // Perform the assignment for non-const variables and for initialization | 1724 // Perform the assignment for non-const variables and for initialization |
1723 // of const variables. Const assignments are simply skipped. | 1725 // of const variables. Const assignments are simply skipped. |
1724 Label done; | 1726 Label done; |
1725 Slot* slot = var->AsSlot(); | 1727 Slot* slot = var->AsSlot(); |
1726 switch (slot->type()) { | 1728 switch (slot->type()) { |
1727 case Slot::PARAMETER: | 1729 case Slot::PARAMETER: |
1728 case Slot::LOCAL: | 1730 case Slot::LOCAL: |
1729 if (op == Token::INIT_CONST) { | 1731 if (op == Token::INIT_CONST) { |
(...skipping 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3740 __ ret(0); | 3742 __ ret(0); |
3741 } | 3743 } |
3742 | 3744 |
3743 | 3745 |
3744 #undef __ | 3746 #undef __ |
3745 | 3747 |
3746 | 3748 |
3747 } } // namespace v8::internal | 3749 } } // namespace v8::internal |
3748 | 3750 |
3749 #endif // V8_TARGET_ARCH_X64 | 3751 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |