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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 9664070: Don't take UnkownOSRValues into account when infering Phi's representation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: improve representation inference for phis with constants Created 8 years, 9 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/hydrogen-instructions.h ('k') | src/runtime.cc » ('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 2239 matching lines...) Expand 10 before | Expand all | Expand 10 after
2250 #undef H_CONSTANT_DOUBLE 2250 #undef H_CONSTANT_DOUBLE
2251 2251
2252 2252
2253 void HIn::PrintDataTo(StringStream* stream) { 2253 void HIn::PrintDataTo(StringStream* stream) {
2254 key()->PrintNameTo(stream); 2254 key()->PrintNameTo(stream);
2255 stream->Add(" "); 2255 stream->Add(" ");
2256 object()->PrintNameTo(stream); 2256 object()->PrintNameTo(stream);
2257 } 2257 }
2258 2258
2259 2259
2260 Representation HPhi::InferredRepresentation() {
2261 bool double_occurred = false;
2262 bool int32_occurred = false;
2263 for (int i = 0; i < OperandCount(); ++i) {
2264 HValue* value = OperandAt(i);
2265 if (value->IsUnknownOSRValue()) continue;
2266 if (value->representation().IsDouble()) double_occurred = true;
2267 if (value->representation().IsInteger32()) int32_occurred = true;
2268 if (value->representation().IsTagged()) {
2269 if (value->IsConstant()) {
2270 HConstant* constant = HConstant::cast(value);
2271 if (constant->IsConvertibleToInteger()) {
2272 int32_occurred = true;
2273 } else if (constant->HasNumberValue()) {
2274 double_occurred = true;
2275 } else {
2276 return Representation::Tagged();
2277 }
2278 } else {
2279 return Representation::Tagged();
2280 }
2281 }
2282 }
2283
2284 if (double_occurred) return Representation::Double();
2285
2286 if (int32_occurred) return Representation::Integer32();
2287
2288 return Representation::None();
2289 }
2290
2291
2260 // Node-specific verification code is only included in debug mode. 2292 // Node-specific verification code is only included in debug mode.
2261 #ifdef DEBUG 2293 #ifdef DEBUG
2262 2294
2263 void HPhi::Verify() { 2295 void HPhi::Verify() {
2264 ASSERT(OperandCount() == block()->predecessors()->length()); 2296 ASSERT(OperandCount() == block()->predecessors()->length());
2265 for (int i = 0; i < OperandCount(); ++i) { 2297 for (int i = 0; i < OperandCount(); ++i) {
2266 HValue* value = OperandAt(i); 2298 HValue* value = OperandAt(i);
2267 HBasicBlock* defining_block = value->block(); 2299 HBasicBlock* defining_block = value->block();
2268 HBasicBlock* predecessor_block = block()->predecessors()->at(i); 2300 HBasicBlock* predecessor_block = block()->predecessors()->at(i);
2269 ASSERT(defining_block == predecessor_block || 2301 ASSERT(defining_block == predecessor_block ||
(...skipping 27 matching lines...) Expand all
2297 2329
2298 2330
2299 void HCheckPrototypeMaps::Verify() { 2331 void HCheckPrototypeMaps::Verify() {
2300 HInstruction::Verify(); 2332 HInstruction::Verify();
2301 ASSERT(HasNoUses()); 2333 ASSERT(HasNoUses());
2302 } 2334 }
2303 2335
2304 #endif 2336 #endif
2305 2337
2306 } } // namespace v8::internal 2338 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698