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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 InputAt(0)->PrintTo(stream); | 289 InputAt(0)->PrintTo(stream); |
290 } | 290 } |
291 | 291 |
292 | 292 |
293 void LLoadContextSlot::PrintDataTo(StringStream* stream) { | 293 void LLoadContextSlot::PrintDataTo(StringStream* stream) { |
294 InputAt(0)->PrintTo(stream); | 294 InputAt(0)->PrintTo(stream); |
295 stream->Add("[%d]", slot_index()); | 295 stream->Add("[%d]", slot_index()); |
296 } | 296 } |
297 | 297 |
298 | 298 |
| 299 void LStoreContextSlot::PrintDataTo(StringStream* stream) { |
| 300 InputAt(0)->PrintTo(stream); |
| 301 stream->Add("[%d] <- ", slot_index()); |
| 302 InputAt(1)->PrintTo(stream); |
| 303 } |
| 304 |
| 305 |
299 void LCallKeyed::PrintDataTo(StringStream* stream) { | 306 void LCallKeyed::PrintDataTo(StringStream* stream) { |
300 stream->Add("[rcx] #%d / ", arity()); | 307 stream->Add("[rcx] #%d / ", arity()); |
301 } | 308 } |
302 | 309 |
303 | 310 |
304 void LCallNamed::PrintDataTo(StringStream* stream) { | 311 void LCallNamed::PrintDataTo(StringStream* stream) { |
305 SmartPointer<char> name_string = name()->ToCString(); | 312 SmartPointer<char> name_string = name()->ToCString(); |
306 stream->Add("%s #%d / ", *name_string, arity()); | 313 stream->Add("%s #%d / ", *name_string, arity()); |
307 } | 314 } |
308 | 315 |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1672 | 1679 |
1673 | 1680 |
1674 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) { | 1681 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) { |
1675 LStoreGlobal* result = new LStoreGlobal(UseRegister(instr->value()), | 1682 LStoreGlobal* result = new LStoreGlobal(UseRegister(instr->value()), |
1676 TempRegister()); | 1683 TempRegister()); |
1677 return instr->check_hole_value() ? AssignEnvironment(result) : result; | 1684 return instr->check_hole_value() ? AssignEnvironment(result) : result; |
1678 } | 1685 } |
1679 | 1686 |
1680 | 1687 |
1681 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 1688 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
1682 Abort("Unimplemented: %s", "DoLoadContextSlot"); | 1689 LOperand* context = UseRegisterAtStart(instr->value()); |
1683 return NULL; | 1690 return DefineAsRegister(new LLoadContextSlot(context)); |
1684 } | 1691 } |
1685 | 1692 |
1686 | 1693 |
1687 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { | 1694 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
1688 Abort("Unimplemented: DoStoreContextSlot"); | 1695 LOperand* context; |
1689 return NULL; | 1696 LOperand* value; |
| 1697 if (instr->NeedsWriteBarrier()) { |
| 1698 context = UseTempRegister(instr->context()); |
| 1699 value = UseTempRegister(instr->value()); |
| 1700 } else { |
| 1701 context = UseRegister(instr->context()); |
| 1702 value = UseRegister(instr->value()); |
| 1703 } |
| 1704 return new LStoreContextSlot(context, value); |
1690 } | 1705 } |
1691 | 1706 |
1692 | 1707 |
1693 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 1708 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
1694 ASSERT(instr->representation().IsTagged()); | 1709 ASSERT(instr->representation().IsTagged()); |
1695 LOperand* obj = UseRegisterAtStart(instr->object()); | 1710 LOperand* obj = UseRegisterAtStart(instr->object()); |
1696 return DefineAsRegister(new LLoadNamedField(obj)); | 1711 return DefineAsRegister(new LLoadNamedField(obj)); |
1697 } | 1712 } |
1698 | 1713 |
1699 | 1714 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1867 } | 1882 } |
1868 | 1883 |
1869 | 1884 |
1870 LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) { | 1885 LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) { |
1871 Abort("Unimplemented: %s", "DoDeleteProperty"); | 1886 Abort("Unimplemented: %s", "DoDeleteProperty"); |
1872 return NULL; | 1887 return NULL; |
1873 } | 1888 } |
1874 | 1889 |
1875 | 1890 |
1876 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { | 1891 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { |
1877 Abort("Unimplemented: %s", "DoOsrEntry"); | 1892 allocator_->MarkAsOsrEntry(); |
1878 return NULL; | 1893 current_block_->last_environment()->set_ast_id(instr->ast_id()); |
| 1894 return AssignEnvironment(new LOsrEntry); |
1879 } | 1895 } |
1880 | 1896 |
1881 | 1897 |
1882 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 1898 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
1883 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 1899 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
1884 return DefineAsSpilled(new LParameter, spill_index); | 1900 return DefineAsSpilled(new LParameter, spill_index); |
1885 } | 1901 } |
1886 | 1902 |
1887 | 1903 |
1888 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 1904 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
1889 Abort("Unimplemented: %s", "DoUnknownOSRValue"); | 1905 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. |
1890 return NULL; | 1906 return DefineAsSpilled(new LUnknownOSRValue, spill_index); |
1891 } | 1907 } |
1892 | 1908 |
1893 | 1909 |
1894 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 1910 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
1895 argument_count_ -= instr->argument_count(); | 1911 argument_count_ -= instr->argument_count(); |
1896 return MarkAsCall(DefineFixed(new LCallStub, rax), instr); | 1912 return MarkAsCall(DefineFixed(new LCallStub, rax), instr); |
1897 } | 1913 } |
1898 | 1914 |
1899 | 1915 |
1900 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { | 1916 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1984 | 2000 |
1985 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2001 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
1986 HEnvironment* outer = current_block_->last_environment()->outer(); | 2002 HEnvironment* outer = current_block_->last_environment()->outer(); |
1987 current_block_->UpdateEnvironment(outer); | 2003 current_block_->UpdateEnvironment(outer); |
1988 return NULL; | 2004 return NULL; |
1989 } | 2005 } |
1990 | 2006 |
1991 } } // namespace v8::internal | 2007 } } // namespace v8::internal |
1992 | 2008 |
1993 #endif // V8_TARGET_ARCH_X64 | 2009 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |