| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 6686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6697 void Reference::SetValue(InitState init_state) { | 6697 void Reference::SetValue(InitState init_state) { |
| 6698 ASSERT(cgen_->HasValidEntryRegisters()); | 6698 ASSERT(cgen_->HasValidEntryRegisters()); |
| 6699 ASSERT(!is_illegal()); | 6699 ASSERT(!is_illegal()); |
| 6700 MacroAssembler* masm = cgen_->masm(); | 6700 MacroAssembler* masm = cgen_->masm(); |
| 6701 switch (type_) { | 6701 switch (type_) { |
| 6702 case SLOT: { | 6702 case SLOT: { |
| 6703 Comment cmnt(masm, "[ Store to Slot"); | 6703 Comment cmnt(masm, "[ Store to Slot"); |
| 6704 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); | 6704 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); |
| 6705 ASSERT(slot != NULL); | 6705 ASSERT(slot != NULL); |
| 6706 cgen_->StoreToSlot(slot, init_state); | 6706 cgen_->StoreToSlot(slot, init_state); |
| 6707 cgen_->UnloadReference(this); |
| 6707 break; | 6708 break; |
| 6708 } | 6709 } |
| 6709 | 6710 |
| 6710 case NAMED: { | 6711 case NAMED: { |
| 6711 Comment cmnt(masm, "[ Store to named Property"); | 6712 Comment cmnt(masm, "[ Store to named Property"); |
| 6712 cgen_->frame()->Push(GetName()); | 6713 cgen_->frame()->Push(GetName()); |
| 6713 Result answer = cgen_->frame()->CallStoreIC(); | 6714 Result answer = cgen_->frame()->CallStoreIC(); |
| 6714 cgen_->frame()->Push(&answer); | 6715 cgen_->frame()->Push(&answer); |
| 6716 cgen_->UnloadReference(this); |
| 6715 break; | 6717 break; |
| 6716 } | 6718 } |
| 6717 | 6719 |
| 6718 case KEYED: { | 6720 case KEYED: { |
| 6719 Comment cmnt(masm, "[ Store to keyed Property"); | 6721 Comment cmnt(masm, "[ Store to keyed Property"); |
| 6720 | 6722 |
| 6721 // Generate inlined version of the keyed store if the code is in | 6723 // Generate inlined version of the keyed store if the code is in |
| 6722 // a loop and the key is likely to be a smi. | 6724 // a loop and the key is likely to be a smi. |
| 6723 Property* property = expression()->AsProperty(); | 6725 Property* property = expression()->AsProperty(); |
| 6724 ASSERT(property != NULL); | 6726 ASSERT(property != NULL); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6807 cgen_->frame()->Push(&value); | 6809 cgen_->frame()->Push(&value); |
| 6808 } else { | 6810 } else { |
| 6809 Result answer = cgen_->frame()->CallKeyedStoreIC(); | 6811 Result answer = cgen_->frame()->CallKeyedStoreIC(); |
| 6810 // Make sure that we do not have a test instruction after the | 6812 // Make sure that we do not have a test instruction after the |
| 6811 // call. A test instruction after the call is used to | 6813 // call. A test instruction after the call is used to |
| 6812 // indicate that we have generated an inline version of the | 6814 // indicate that we have generated an inline version of the |
| 6813 // keyed store. | 6815 // keyed store. |
| 6814 __ nop(); | 6816 __ nop(); |
| 6815 cgen_->frame()->Push(&answer); | 6817 cgen_->frame()->Push(&answer); |
| 6816 } | 6818 } |
| 6819 cgen_->UnloadReference(this); |
| 6817 break; | 6820 break; |
| 6818 } | 6821 } |
| 6819 | 6822 |
| 6820 default: | 6823 default: |
| 6821 UNREACHABLE(); | 6824 UNREACHABLE(); |
| 6822 } | 6825 } |
| 6823 cgen_->UnloadReference(this); | |
| 6824 } | 6826 } |
| 6825 | 6827 |
| 6826 | 6828 |
| 6827 void FastNewClosureStub::Generate(MacroAssembler* masm) { | 6829 void FastNewClosureStub::Generate(MacroAssembler* masm) { |
| 6828 // Clone the boilerplate in new space. Set the context to the | 6830 // Clone the boilerplate in new space. Set the context to the |
| 6829 // current context in esi. | 6831 // current context in esi. |
| 6830 Label gc; | 6832 Label gc; |
| 6831 __ AllocateInNewSpace(JSFunction::kSize, eax, ebx, ecx, &gc, TAG_OBJECT); | 6833 __ AllocateInNewSpace(JSFunction::kSize, eax, ebx, ecx, &gc, TAG_OBJECT); |
| 6832 | 6834 |
| 6833 // Get the boilerplate function from the stack. | 6835 // Get the boilerplate function from the stack. |
| (...skipping 3257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10091 | 10093 |
| 10092 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 10094 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
| 10093 // tagged as a small integer. | 10095 // tagged as a small integer. |
| 10094 __ bind(&runtime); | 10096 __ bind(&runtime); |
| 10095 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); | 10097 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); |
| 10096 } | 10098 } |
| 10097 | 10099 |
| 10098 #undef __ | 10100 #undef __ |
| 10099 | 10101 |
| 10100 } } // namespace v8::internal | 10102 } } // namespace v8::internal |
| OLD | NEW |