| 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 5991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6002 void Reference::SetValue(InitState init_state) { | 6002 void Reference::SetValue(InitState init_state) { |
| 6003 ASSERT(cgen_->HasValidEntryRegisters()); | 6003 ASSERT(cgen_->HasValidEntryRegisters()); |
| 6004 ASSERT(!is_illegal()); | 6004 ASSERT(!is_illegal()); |
| 6005 MacroAssembler* masm = cgen_->masm(); | 6005 MacroAssembler* masm = cgen_->masm(); |
| 6006 switch (type_) { | 6006 switch (type_) { |
| 6007 case SLOT: { | 6007 case SLOT: { |
| 6008 Comment cmnt(masm, "[ Store to Slot"); | 6008 Comment cmnt(masm, "[ Store to Slot"); |
| 6009 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); | 6009 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); |
| 6010 ASSERT(slot != NULL); | 6010 ASSERT(slot != NULL); |
| 6011 cgen_->StoreToSlot(slot, init_state); | 6011 cgen_->StoreToSlot(slot, init_state); |
| 6012 cgen_->UnloadReference(this); |
| 6012 break; | 6013 break; |
| 6013 } | 6014 } |
| 6014 | 6015 |
| 6015 case NAMED: { | 6016 case NAMED: { |
| 6016 Comment cmnt(masm, "[ Store to named Property"); | 6017 Comment cmnt(masm, "[ Store to named Property"); |
| 6017 cgen_->frame()->Push(GetName()); | 6018 cgen_->frame()->Push(GetName()); |
| 6018 Result answer = cgen_->frame()->CallStoreIC(); | 6019 Result answer = cgen_->frame()->CallStoreIC(); |
| 6019 cgen_->frame()->Push(&answer); | 6020 cgen_->frame()->Push(&answer); |
| 6021 cgen_->UnloadReference(this); |
| 6020 break; | 6022 break; |
| 6021 } | 6023 } |
| 6022 | 6024 |
| 6023 case KEYED: { | 6025 case KEYED: { |
| 6024 Comment cmnt(masm, "[ Store to keyed Property"); | 6026 Comment cmnt(masm, "[ Store to keyed Property"); |
| 6025 | 6027 |
| 6026 // Generate inlined version of the keyed store if the code is in | 6028 // Generate inlined version of the keyed store if the code is in |
| 6027 // a loop and the key is likely to be a smi. | 6029 // a loop and the key is likely to be a smi. |
| 6028 Property* property = expression()->AsProperty(); | 6030 Property* property = expression()->AsProperty(); |
| 6029 ASSERT(property != NULL); | 6031 ASSERT(property != NULL); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6111 cgen_->frame()->Push(&value); | 6113 cgen_->frame()->Push(&value); |
| 6112 } else { | 6114 } else { |
| 6113 Result answer = cgen_->frame()->CallKeyedStoreIC(); | 6115 Result answer = cgen_->frame()->CallKeyedStoreIC(); |
| 6114 // Make sure that we do not have a test instruction after the | 6116 // Make sure that we do not have a test instruction after the |
| 6115 // call. A test instruction after the call is used to | 6117 // call. A test instruction after the call is used to |
| 6116 // indicate that we have generated an inline version of the | 6118 // indicate that we have generated an inline version of the |
| 6117 // keyed store. | 6119 // keyed store. |
| 6118 masm->nop(); | 6120 masm->nop(); |
| 6119 cgen_->frame()->Push(&answer); | 6121 cgen_->frame()->Push(&answer); |
| 6120 } | 6122 } |
| 6123 cgen_->UnloadReference(this); |
| 6121 break; | 6124 break; |
| 6122 } | 6125 } |
| 6123 | 6126 |
| 6124 default: | 6127 default: |
| 6125 UNREACHABLE(); | 6128 UNREACHABLE(); |
| 6126 } | 6129 } |
| 6127 cgen_->UnloadReference(this); | |
| 6128 } | 6130 } |
| 6129 | 6131 |
| 6130 | 6132 |
| 6131 void FastNewClosureStub::Generate(MacroAssembler* masm) { | 6133 void FastNewClosureStub::Generate(MacroAssembler* masm) { |
| 6132 // Clone the boilerplate in new space. Set the context to the | 6134 // Clone the boilerplate in new space. Set the context to the |
| 6133 // current context in rsi. | 6135 // current context in rsi. |
| 6134 Label gc; | 6136 Label gc; |
| 6135 __ AllocateInNewSpace(JSFunction::kSize, rax, rbx, rcx, &gc, TAG_OBJECT); | 6137 __ AllocateInNewSpace(JSFunction::kSize, rax, rbx, rcx, &gc, TAG_OBJECT); |
| 6136 | 6138 |
| 6137 // Get the boilerplate function from the stack. | 6139 // Get the boilerplate function from the stack. |
| (...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8756 // Call the function from C++. | 8758 // Call the function from C++. |
| 8757 return FUNCTION_CAST<ModuloFunction>(buffer); | 8759 return FUNCTION_CAST<ModuloFunction>(buffer); |
| 8758 } | 8760 } |
| 8759 | 8761 |
| 8760 #endif | 8762 #endif |
| 8761 | 8763 |
| 8762 | 8764 |
| 8763 #undef __ | 8765 #undef __ |
| 8764 | 8766 |
| 8765 } } // namespace v8::internal | 8767 } } // namespace v8::internal |
| OLD | NEW |