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

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

Issue 13426006: Improvements for x87 stack handling (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Improvements Created 7 years, 8 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
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 operand->IsUsedAtStart()); 84 operand->IsUsedAtStart());
85 } 85 }
86 for (TempIterator it(this); !it.Done(); it.Advance()) { 86 for (TempIterator it(this); !it.Done(); it.Advance()) {
87 LUnallocated* operand = LUnallocated::cast(it.Current()); 87 LUnallocated* operand = LUnallocated::cast(it.Current());
88 ASSERT(operand->HasFixedPolicy() ||!operand->HasRegisterPolicy()); 88 ASSERT(operand->HasFixedPolicy() ||!operand->HasRegisterPolicy());
89 } 89 }
90 } 90 }
91 #endif 91 #endif
92 92
93 93
94 bool LInstruction::HasDoubleRegisterResult() {
95 return HasResult() && result()->IsDoubleRegister();
96 }
97
98
94 void LInstruction::PrintTo(StringStream* stream) { 99 void LInstruction::PrintTo(StringStream* stream) {
95 stream->Add("%s ", this->Mnemonic()); 100 stream->Add("%s ", this->Mnemonic());
96 101
97 PrintOutputOperandTo(stream); 102 PrintOutputOperandTo(stream);
98 103
99 PrintDataTo(stream); 104 PrintDataTo(stream);
100 105
101 if (HasEnvironment()) { 106 if (HasEnvironment()) {
102 stream->Add(" "); 107 stream->Add(" ");
103 environment()->PrintTo(stream); 108 environment()->PrintTo(stream);
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 LOperand* LChunkBuilder::UseFixed(HValue* value, Register fixed_register) { 540 LOperand* LChunkBuilder::UseFixed(HValue* value, Register fixed_register) {
536 return Use(value, ToUnallocated(fixed_register)); 541 return Use(value, ToUnallocated(fixed_register));
537 } 542 }
538 543
539 544
540 LOperand* LChunkBuilder::UseFixedDouble(HValue* value, XMMRegister reg) { 545 LOperand* LChunkBuilder::UseFixedDouble(HValue* value, XMMRegister reg) {
541 return Use(value, ToUnallocated(reg)); 546 return Use(value, ToUnallocated(reg));
542 } 547 }
543 548
544 549
550 LOperand* LChunkBuilder::UseX87TopOfStack(HValue* value) {
551 return Use(value, ToUnallocated(x87tos));
552 }
553
554
545 LOperand* LChunkBuilder::UseRegister(HValue* value) { 555 LOperand* LChunkBuilder::UseRegister(HValue* value) {
546 return Use(value, new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER)); 556 return Use(value, new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
547 } 557 }
548 558
549 559
550 LOperand* LChunkBuilder::UseRegisterAtStart(HValue* value) { 560 LOperand* LChunkBuilder::UseRegisterAtStart(HValue* value) {
551 return Use(value, 561 return Use(value,
552 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER, 562 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER,
553 LUnallocated::USED_AT_START)); 563 LUnallocated::USED_AT_START));
554 } 564 }
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 // building a stack frame. 1864 // building a stack frame.
1855 if (from.IsTagged()) { 1865 if (from.IsTagged()) {
1856 if (to.IsDouble()) { 1866 if (to.IsDouble()) {
1857 info()->MarkAsDeferredCalling(); 1867 info()->MarkAsDeferredCalling();
1858 LOperand* value = UseRegister(instr->value()); 1868 LOperand* value = UseRegister(instr->value());
1859 // Temp register only necessary for minus zero check. 1869 // Temp register only necessary for minus zero check.
1860 LOperand* temp = instr->deoptimize_on_minus_zero() 1870 LOperand* temp = instr->deoptimize_on_minus_zero()
1861 ? TempRegister() 1871 ? TempRegister()
1862 : NULL; 1872 : NULL;
1863 LNumberUntagD* res = new(zone()) LNumberUntagD(value, temp); 1873 LNumberUntagD* res = new(zone()) LNumberUntagD(value, temp);
1864 return AssignEnvironment(DefineAsRegister(res)); 1874 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
1875 return AssignEnvironment(DefineAsRegister(res));
1876 } else {
1877 return AssignEnvironment(DefineX87TOS(res));
1878 }
1865 } else { 1879 } else {
1866 ASSERT(to.IsInteger32()); 1880 ASSERT(to.IsInteger32());
1867 LOperand* value = UseRegister(instr->value());
1868 if (instr->value()->type().IsSmi()) { 1881 if (instr->value()->type().IsSmi()) {
1882 LOperand* value = UseRegister(instr->value());
1869 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); 1883 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false));
1870 } else { 1884 } else {
1871 bool truncating = instr->CanTruncateToInt32(); 1885 bool truncating = instr->CanTruncateToInt32();
1872 LOperand* xmm_temp = 1886 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
1873 (truncating && CpuFeatures::IsSupported(SSE3)) 1887 LOperand* value = UseRegister(instr->value());
1874 ? NULL 1888 LOperand* xmm_temp =
1875 : FixedTemp(xmm1); 1889 (truncating && CpuFeatures::IsSupported(SSE3))
1876 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp); 1890 ? NULL
1877 return AssignEnvironment(DefineSameAsFirst(res)); 1891 : FixedTemp(xmm1);
1892 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp);
1893 return AssignEnvironment(DefineSameAsFirst(res));
1894 } else {
1895 LOperand* value = UseFixed(instr->value(), ecx);
1896 LTaggedToINoSSE2* res =
1897 new(zone()) LTaggedToINoSSE2(value, TempRegister(),
1898 TempRegister(), TempRegister());
1899 return AssignEnvironment(DefineFixed(res, ecx));
1900 }
1878 } 1901 }
1879 } 1902 }
1880 } else if (from.IsDouble()) { 1903 } else if (from.IsDouble()) {
1881 if (to.IsTagged()) { 1904 if (to.IsTagged()) {
1882 info()->MarkAsDeferredCalling(); 1905 info()->MarkAsDeferredCalling();
1883 LOperand* value = CpuFeatures::IsSupported(SSE2) 1906 LOperand* value = CpuFeatures::IsSupported(SSE2)
1884 ? UseRegisterAtStart(instr->value()) 1907 ? UseRegisterAtStart(instr->value())
1885 : UseAtStart(instr->value()); 1908 : UseAtStart(instr->value());
1886 LOperand* temp = FLAG_inline_new ? TempRegister() : NULL; 1909 LOperand* temp = FLAG_inline_new ? TempRegister() : NULL;
1887 1910
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1985 HValue* value = instr->value(); 2008 HValue* value = instr->value();
1986 Representation input_rep = value->representation(); 2009 Representation input_rep = value->representation();
1987 if (input_rep.IsDouble()) { 2010 if (input_rep.IsDouble()) {
1988 LOperand* reg = UseRegister(value); 2011 LOperand* reg = UseRegister(value);
1989 return DefineFixed(new(zone()) LClampDToUint8(reg), eax); 2012 return DefineFixed(new(zone()) LClampDToUint8(reg), eax);
1990 } else if (input_rep.IsInteger32()) { 2013 } else if (input_rep.IsInteger32()) {
1991 LOperand* reg = UseFixed(value, eax); 2014 LOperand* reg = UseFixed(value, eax);
1992 return DefineFixed(new(zone()) LClampIToUint8(reg), eax); 2015 return DefineFixed(new(zone()) LClampIToUint8(reg), eax);
1993 } else { 2016 } else {
1994 ASSERT(input_rep.IsTagged()); 2017 ASSERT(input_rep.IsTagged());
1995 LOperand* reg = UseFixed(value, eax); 2018 if (CpuFeatures::IsSupported(SSE2)) {
1996 // Register allocator doesn't (yet) support allocation of double 2019 LOperand* reg = UseFixed(value, eax);
1997 // temps. Reserve xmm1 explicitly. 2020 // Register allocator doesn't (yet) support allocation of double
1998 LOperand* temp = FixedTemp(xmm1); 2021 // temps. Reserve xmm1 explicitly.
1999 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, temp); 2022 LOperand* temp = FixedTemp(xmm1);
2000 return AssignEnvironment(DefineFixed(result, eax)); 2023 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, temp);
2024 return AssignEnvironment(DefineFixed(result, eax));
2025 } else {
2026 LOperand* value = UseRegister(instr->value());
2027 LClampTToUint8NoSSE2* res =
2028 new(zone()) LClampTToUint8NoSSE2(value, TempRegister(),
2029 TempRegister(), TempRegister());
2030 return AssignEnvironment(DefineFixed(res, ecx));
2031 }
2001 } 2032 }
2002 } 2033 }
2003 2034
2004 2035
2005 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { 2036 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
2006 LOperand* context = info()->IsStub() 2037 LOperand* context = info()->IsStub()
2007 ? UseFixed(instr->context(), esi) 2038 ? UseFixed(instr->context(), esi)
2008 : NULL; 2039 : NULL;
2009 LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count()); 2040 LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count());
2010 return new(zone()) LReturn(UseFixed(instr->value(), eax), context, 2041 return new(zone()) LReturn(UseFixed(instr->value(), eax), context,
2011 parameter_count); 2042 parameter_count);
2012 } 2043 }
2013 2044
2014 2045
2015 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { 2046 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
2016 Representation r = instr->representation(); 2047 Representation r = instr->representation();
2017 if (r.IsInteger32()) { 2048 if (r.IsInteger32()) {
2018 return DefineAsRegister(new(zone()) LConstantI); 2049 return DefineAsRegister(new(zone()) LConstantI);
2019 } else if (r.IsDouble()) { 2050 } else if (r.IsDouble()) {
2020 double value = instr->DoubleValue(); 2051 double value = instr->DoubleValue();
2021 LOperand* temp = (BitCast<uint64_t, double>(value) != 0) 2052 bool value_is_zero = BitCast<uint64_t, double>(value) == 0;
2022 ? TempRegister() 2053 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
2023 : NULL; 2054 LOperand* temp = value_is_zero ? NULL : TempRegister();
2024 return DefineAsRegister(new(zone()) LConstantD(temp)); 2055 return DefineAsRegister(new(zone()) LConstantD(temp));
2056 } else {
2057 return DefineX87TOS(new(zone()) LConstantD(NULL));
2058 }
2025 } else if (r.IsTagged()) { 2059 } else if (r.IsTagged()) {
2026 return DefineAsRegister(new(zone()) LConstantT); 2060 return DefineAsRegister(new(zone()) LConstantT);
2027 } else { 2061 } else {
2028 UNREACHABLE(); 2062 UNREACHABLE();
2029 return NULL; 2063 return NULL;
2030 } 2064 }
2031 } 2065 }
2032 2066
2033 2067
2034 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { 2068 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2183 LOperand* context = UseFixed(instr->context(), esi); 2217 LOperand* context = UseFixed(instr->context(), esi);
2184 LOperand* object = UseFixed(instr->object(), edx); 2218 LOperand* object = UseFixed(instr->object(), edx);
2185 LOperand* key = UseFixed(instr->key(), ecx); 2219 LOperand* key = UseFixed(instr->key(), ecx);
2186 2220
2187 LLoadKeyedGeneric* result = 2221 LLoadKeyedGeneric* result =
2188 new(zone()) LLoadKeyedGeneric(context, object, key); 2222 new(zone()) LLoadKeyedGeneric(context, object, key);
2189 return MarkAsCall(DefineFixed(result, eax), instr); 2223 return MarkAsCall(DefineFixed(result, eax), instr);
2190 } 2224 }
2191 2225
2192 2226
2227 LOperand* LChunkBuilder::GetStoreKeyedValueOperand(HStoreKeyed* instr) {
danno 2013/04/08 12:57:27 Is this change related?
mvstanton 2013/04/08 16:10:14 Nope, removed
2228 ElementsKind elements_kind = instr->elements_kind();
2229
2230 // Determine if we need a byte register in this case for the value.
2231 bool val_is_fixed_register =
2232 elements_kind == EXTERNAL_BYTE_ELEMENTS ||
2233 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS ||
2234 elements_kind == EXTERNAL_PIXEL_ELEMENTS;
2235 if (val_is_fixed_register) {
2236 return UseFixed(instr->value(), eax);
2237 }
2238
2239 if (!CpuFeatures::IsSafeForSnapshot(SSE2) &&
2240 IsDoubleOrFloatElementsKind(elements_kind)) {
2241 return UseRegisterAtStart(instr->value());
2242 }
2243
2244 return UseRegister(instr->value());
2245 }
2246
2247
2193 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2248 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2194 if (!instr->is_external()) { 2249 if (!instr->is_external()) {
2195 ASSERT(instr->elements()->representation().IsTagged()); 2250 ASSERT(instr->elements()->representation().IsTagged());
2196 ASSERT(instr->key()->representation().IsInteger32() || 2251 ASSERT(instr->key()->representation().IsInteger32() ||
2197 instr->key()->representation().IsTagged()); 2252 instr->key()->representation().IsTagged());
2198 2253
2199 if (instr->value()->representation().IsDouble()) { 2254 if (instr->value()->representation().IsDouble()) {
2200 LOperand* object = UseRegisterAtStart(instr->elements()); 2255 LOperand* object = UseRegisterAtStart(instr->elements());
2201 LOperand* val = UseTempRegister(instr->value()); 2256 LOperand* val = NULL;
2257 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
2258 val = UseRegisterAtStart(instr->value());
2259 } else {
2260 if (!instr->IsConstantHoleStore()) {
2261 val = UseX87TopOfStack(instr->value());
2262 }
2263 }
2202 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 2264 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
2203
2204 return new(zone()) LStoreKeyed(object, key, val); 2265 return new(zone()) LStoreKeyed(object, key, val);
2205 } else { 2266 } else {
2206 ASSERT(instr->value()->representation().IsTagged()); 2267 ASSERT(instr->value()->representation().IsTagged());
2207 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2268 bool needs_write_barrier = instr->NeedsWriteBarrier();
2208 2269
2209 LOperand* obj = UseRegister(instr->elements()); 2270 LOperand* obj = UseRegister(instr->elements());
2210 LOperand* val = needs_write_barrier 2271 LOperand* val;
2211 ? UseTempRegister(instr->value()) 2272 LOperand* key;
2212 : UseRegisterAtStart(instr->value()); 2273 if (needs_write_barrier) {
2213 LOperand* key = needs_write_barrier 2274 val = UseTempRegister(instr->value());
mvstanton 2013/04/08 16:10:14 This change is unrelated, removing.
2214 ? UseTempRegister(instr->key()) 2275 key = UseTempRegister(instr->key());
2215 : UseRegisterOrConstantAtStart(instr->key()); 2276 } else {
2277 val = UseRegisterOrConstantAtStart(instr->value());
2278 key = UseRegisterOrConstantAtStart(instr->key());
2279 }
2216 return new(zone()) LStoreKeyed(obj, key, val); 2280 return new(zone()) LStoreKeyed(obj, key, val);
2217 } 2281 }
2218 } 2282 }
2219 2283
2220 ElementsKind elements_kind = instr->elements_kind(); 2284 ElementsKind elements_kind = instr->elements_kind();
2221 ASSERT( 2285 ASSERT(
2222 (instr->value()->representation().IsInteger32() && 2286 (instr->value()->representation().IsInteger32() &&
2223 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && 2287 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) &&
2224 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || 2288 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) ||
2225 (instr->value()->representation().IsDouble() && 2289 (instr->value()->representation().IsDouble() &&
2226 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || 2290 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) ||
2227 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); 2291 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS))));
2228 ASSERT(instr->elements()->representation().IsExternal()); 2292 ASSERT(instr->elements()->representation().IsExternal());
2229 2293
2230 LOperand* external_pointer = UseRegister(instr->elements()); 2294 LOperand* external_pointer = UseRegister(instr->elements());
2231 // Determine if we need a byte register in this case for the value. 2295 LOperand* val = GetStoreKeyedValueOperand(instr);
2232 bool val_is_fixed_register =
2233 elements_kind == EXTERNAL_BYTE_ELEMENTS ||
2234 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS ||
2235 elements_kind == EXTERNAL_PIXEL_ELEMENTS;
2236
2237 LOperand* val = val_is_fixed_register
2238 ? UseFixed(instr->value(), eax)
2239 : UseRegister(instr->value());
2240 bool clobbers_key = ExternalArrayOpRequiresTemp( 2296 bool clobbers_key = ExternalArrayOpRequiresTemp(
2241 instr->key()->representation(), elements_kind); 2297 instr->key()->representation(), elements_kind);
2242 LOperand* key = clobbers_key 2298 LOperand* key = clobbers_key
2243 ? UseTempRegister(instr->key()) 2299 ? UseTempRegister(instr->key())
2244 : UseRegisterOrConstantAtStart(instr->key()); 2300 : UseRegisterOrConstantAtStart(instr->key());
2245 return new(zone()) LStoreKeyed(external_pointer, 2301 return new(zone()) LStoreKeyed(external_pointer,
2246 key, 2302 key,
2247 val); 2303 val);
2248 } 2304 }
2249 2305
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 ? UseRegister(instr->object()) 2371 ? UseRegister(instr->object())
2316 : UseTempRegister(instr->object()); 2372 : UseTempRegister(instr->object());
2317 } else { 2373 } else {
2318 obj = needs_write_barrier_for_map 2374 obj = needs_write_barrier_for_map
2319 ? UseRegister(instr->object()) 2375 ? UseRegister(instr->object())
2320 : UseRegisterAtStart(instr->object()); 2376 : UseRegisterAtStart(instr->object());
2321 } 2377 }
2322 2378
2323 LOperand* val = needs_write_barrier 2379 LOperand* val = needs_write_barrier
2324 ? UseTempRegister(instr->value()) 2380 ? UseTempRegister(instr->value())
2325 : UseRegister(instr->value()); 2381 : UseRegisterOrConstant(instr->value());
danno 2013/04/08 12:57:27 Is this change related?
mvstanton 2013/04/08 16:10:14 Nope, removed.
2326 2382
2327 // We only need a scratch register if we have a write barrier or we 2383 // We only need a scratch register if we have a write barrier or we
2328 // have a store into the properties array (not in-object-property). 2384 // have a store into the properties array (not in-object-property).
2329 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || 2385 LOperand* temp = (!instr->is_in_object() || needs_write_barrier ||
2330 needs_write_barrier_for_map) ? TempRegister() : NULL; 2386 needs_write_barrier_for_map) ? TempRegister() : NULL;
2331 2387
2332 // We need a temporary register for write barrier of the map field. 2388 // We need a temporary register for write barrier of the map field.
2333 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; 2389 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL;
2334 2390
2335 return new(zone()) LStoreNamedField(obj, val, temp, temp_map); 2391 return new(zone()) LStoreNamedField(obj, val, temp, temp_map);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2454 2510
2455 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { 2511 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
2456 LParameter* result = new(zone()) LParameter; 2512 LParameter* result = new(zone()) LParameter;
2457 if (instr->kind() == HParameter::STACK_PARAMETER) { 2513 if (instr->kind() == HParameter::STACK_PARAMETER) {
2458 int spill_index = chunk()->GetParameterStackSlot(instr->index()); 2514 int spill_index = chunk()->GetParameterStackSlot(instr->index());
2459 return DefineAsSpilled(result, spill_index); 2515 return DefineAsSpilled(result, spill_index);
2460 } else { 2516 } else {
2461 ASSERT(info()->IsStub()); 2517 ASSERT(info()->IsStub());
2462 CodeStubInterfaceDescriptor* descriptor = 2518 CodeStubInterfaceDescriptor* descriptor =
2463 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); 2519 info()->code_stub()->GetInterfaceDescriptor(info()->isolate());
2464 Register reg = descriptor->register_params_[instr->index()]; 2520 Register reg;
danno 2013/04/08 12:57:27 unrelated change?
mvstanton 2013/04/08 16:10:14 Yep, removed
2521 if (static_cast<int>(instr->index()) == descriptor->register_param_count_) {
2522 reg = *(descriptor->stack_parameter_count_);
2523 } else {
2524 reg = descriptor->register_params_[instr->index()];
2525 }
2465 return DefineFixed(result, reg); 2526 return DefineFixed(result, reg);
2466 } 2527 }
2467 } 2528 }
2468 2529
2469 2530
2470 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { 2531 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
2471 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. 2532 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width.
2472 if (spill_index > LUnallocated::kMaxFixedIndex) { 2533 if (spill_index > LUnallocated::kMaxFixedIndex) {
2473 Abort("Too many spill slots needed for OSR"); 2534 Abort("Too many spill slots needed for OSR");
2474 spill_index = 0; 2535 spill_index = 0;
(...skipping 14 matching lines...) Expand all
2489 // There are no real uses of the arguments object. 2550 // There are no real uses of the arguments object.
2490 // arguments.length and element access are supported directly on 2551 // arguments.length and element access are supported directly on
2491 // stack arguments, and any real arguments object use causes a bailout. 2552 // stack arguments, and any real arguments object use causes a bailout.
2492 // So this value is never used. 2553 // So this value is never used.
2493 return NULL; 2554 return NULL;
2494 } 2555 }
2495 2556
2496 2557
2497 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { 2558 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
2498 LOperand* args = UseRegister(instr->arguments()); 2559 LOperand* args = UseRegister(instr->arguments());
2499 LOperand* length = UseTempRegister(instr->length()); 2560 LOperand* length;
danno 2013/04/08 12:57:27 unrelated change?
mvstanton 2013/04/08 16:10:14 Indeed, thx.
2500 LOperand* index = Use(instr->index()); 2561 LOperand* index;
2562 if (instr->length()->IsConstant() && instr->index()->IsConstant()) {
2563 length = UseRegisterOrConstant(instr->length());
2564 index = UseOrConstant(instr->index());
2565 } else {
2566 length = UseTempRegister(instr->length());
2567 index = Use(instr->index());
2568 }
2501 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); 2569 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index));
2502 } 2570 }
2503 2571
2504 2572
2505 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { 2573 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) {
2506 LOperand* object = UseFixed(instr->value(), eax); 2574 LOperand* object = UseFixed(instr->value(), eax);
2507 LToFastProperties* result = new(zone()) LToFastProperties(object); 2575 LToFastProperties* result = new(zone()) LToFastProperties(object);
2508 return MarkAsCall(DefineFixed(result, eax), instr); 2576 return MarkAsCall(DefineFixed(result, eax), instr);
2509 } 2577 }
2510 2578
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2648 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2716 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2649 LOperand* object = UseRegister(instr->object()); 2717 LOperand* object = UseRegister(instr->object());
2650 LOperand* index = UseTempRegister(instr->index()); 2718 LOperand* index = UseTempRegister(instr->index());
2651 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2719 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2652 } 2720 }
2653 2721
2654 2722
2655 } } // namespace v8::internal 2723 } } // namespace v8::internal
2656 2724
2657 #endif // V8_TARGET_ARCH_IA32 2725 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/ia32/lithium-ia32.h ('K') | « src/ia32/lithium-ia32.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698