Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 11550005: Elide unnecessary context reload in generated stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/lithium.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 1048
1049 1049
1050 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { 1050 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) {
1051 return instr->HasNoUses() 1051 return instr->HasNoUses()
1052 ? NULL 1052 ? NULL
1053 : DefineAsRegister(new(zone()) LThisFunction); 1053 : DefineAsRegister(new(zone()) LThisFunction);
1054 } 1054 }
1055 1055
1056 1056
1057 LInstruction* LChunkBuilder::DoContext(HContext* instr) { 1057 LInstruction* LChunkBuilder::DoContext(HContext* instr) {
1058 return instr->HasNoUses() ? NULL : DefineAsRegister(new(zone()) LContext); 1058 if (instr->HasNoUses()) return NULL;
1059
1060 if (info()->IsStub()) {
1061 return DefineFixed(new(zone()) LContext, esi);
1062 }
1063
1064 return DefineAsRegister(new(zone()) LContext);
1059 } 1065 }
1060 1066
1061 1067
1062 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { 1068 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
1063 LOperand* context = UseRegisterAtStart(instr->value()); 1069 LOperand* context = UseRegisterAtStart(instr->value());
1064 return DefineAsRegister(new(zone()) LOuterContext(context)); 1070 return DefineAsRegister(new(zone()) LOuterContext(context));
1065 } 1071 }
1066 1072
1067 1073
1068 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { 1074 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 // Register allocator doesn't (yet) support allocation of double 1864 // Register allocator doesn't (yet) support allocation of double
1859 // temps. Reserve xmm1 explicitly. 1865 // temps. Reserve xmm1 explicitly.
1860 LOperand* temp = FixedTemp(xmm1); 1866 LOperand* temp = FixedTemp(xmm1);
1861 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, temp); 1867 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, temp);
1862 return AssignEnvironment(DefineFixed(result, eax)); 1868 return AssignEnvironment(DefineFixed(result, eax));
1863 } 1869 }
1864 } 1870 }
1865 1871
1866 1872
1867 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { 1873 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
1868 return new(zone()) LReturn(UseFixed(instr->value(), eax)); 1874 LOperand* context = info()->IsStub()
1875 ? UseFixed(instr->context(), esi)
1876 : NULL;
1877 return new(zone()) LReturn(UseFixed(instr->value(), eax), context);
1869 } 1878 }
1870 1879
1871 1880
1872 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { 1881 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
1873 Representation r = instr->representation(); 1882 Representation r = instr->representation();
1874 if (r.IsInteger32()) { 1883 if (r.IsInteger32()) {
1875 return DefineAsRegister(new(zone()) LConstantI); 1884 return DefineAsRegister(new(zone()) LConstantI);
1876 } else if (r.IsDouble()) { 1885 } else if (r.IsDouble()) {
1877 double value = instr->DoubleValue(); 1886 double value = instr->DoubleValue();
1878 LOperand* temp = (BitCast<uint64_t, double>(value) != 0) 1887 LOperand* temp = (BitCast<uint64_t, double>(value) != 0)
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
2478 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2487 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2479 LOperand* object = UseRegister(instr->object()); 2488 LOperand* object = UseRegister(instr->object());
2480 LOperand* index = UseTempRegister(instr->index()); 2489 LOperand* index = UseTempRegister(instr->index());
2481 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2490 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2482 } 2491 }
2483 2492
2484 2493
2485 } } // namespace v8::internal 2494 } } // namespace v8::internal
2486 2495
2487 #endif // V8_TARGET_ARCH_IA32 2496 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/lithium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698