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/type-info.cc

Issue 7112032: Re-land r8140: Deoptimize on never-executed code-paths. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 6 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.cc ('k') | src/x64/lithium-x64.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 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 Handle<Object> object = GetInfo(expr->id()); 217 Handle<Object> object = GetInfo(expr->id());
218 TypeInfo unknown = TypeInfo::Unknown(); 218 TypeInfo unknown = TypeInfo::Unknown();
219 if (!object->IsCode()) return unknown; 219 if (!object->IsCode()) return unknown;
220 Handle<Code> code = Handle<Code>::cast(object); 220 Handle<Code> code = Handle<Code>::cast(object);
221 if (!code->is_compare_ic_stub()) return unknown; 221 if (!code->is_compare_ic_stub()) return unknown;
222 222
223 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); 223 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state());
224 switch (state) { 224 switch (state) {
225 case CompareIC::UNINITIALIZED: 225 case CompareIC::UNINITIALIZED:
226 // Uninitialized means never executed. 226 // Uninitialized means never executed.
227 // TODO(fschneider): Introduce a separate value for never-executed ICs. 227 return TypeInfo::Uninitialized();
228 return unknown;
229 case CompareIC::SMIS: 228 case CompareIC::SMIS:
230 return TypeInfo::Smi(); 229 return TypeInfo::Smi();
231 case CompareIC::HEAP_NUMBERS: 230 case CompareIC::HEAP_NUMBERS:
232 return TypeInfo::Number(); 231 return TypeInfo::Number();
233 case CompareIC::SYMBOLS: 232 case CompareIC::SYMBOLS:
234 case CompareIC::STRINGS: 233 case CompareIC::STRINGS:
235 return TypeInfo::String(); 234 return TypeInfo::String();
236 case CompareIC::OBJECTS: 235 case CompareIC::OBJECTS:
237 // TODO(kasperl): We really need a type for JS objects here. 236 // TODO(kasperl): We really need a type for JS objects here.
238 return TypeInfo::NonPrimitive(); 237 return TypeInfo::NonPrimitive();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 Handle<Code> code = Handle<Code>::cast(object); 278 Handle<Code> code = Handle<Code>::cast(object);
280 if (code->is_binary_op_stub()) { 279 if (code->is_binary_op_stub()) {
281 BinaryOpIC::TypeInfo type = static_cast<BinaryOpIC::TypeInfo>( 280 BinaryOpIC::TypeInfo type = static_cast<BinaryOpIC::TypeInfo>(
282 code->binary_op_type()); 281 code->binary_op_type());
283 BinaryOpIC::TypeInfo result_type = static_cast<BinaryOpIC::TypeInfo>( 282 BinaryOpIC::TypeInfo result_type = static_cast<BinaryOpIC::TypeInfo>(
284 code->binary_op_result_type()); 283 code->binary_op_result_type());
285 284
286 switch (type) { 285 switch (type) {
287 case BinaryOpIC::UNINITIALIZED: 286 case BinaryOpIC::UNINITIALIZED:
288 // Uninitialized means never executed. 287 // Uninitialized means never executed.
289 // TODO(fschneider): Introduce a separate value for never-executed ICs 288 return TypeInfo::Uninitialized();
290 return unknown;
291 case BinaryOpIC::SMI: 289 case BinaryOpIC::SMI:
292 switch (result_type) { 290 switch (result_type) {
293 case BinaryOpIC::UNINITIALIZED: 291 case BinaryOpIC::UNINITIALIZED:
294 case BinaryOpIC::SMI: 292 case BinaryOpIC::SMI:
295 return TypeInfo::Smi(); 293 return TypeInfo::Smi();
296 case BinaryOpIC::INT32: 294 case BinaryOpIC::INT32:
297 return TypeInfo::Integer32(); 295 return TypeInfo::Integer32();
298 case BinaryOpIC::HEAP_NUMBER: 296 case BinaryOpIC::HEAP_NUMBER:
299 return TypeInfo::Double(); 297 return TypeInfo::Double();
300 default: 298 default:
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 static_cast<int>(info->pc() - code->instruction_start())); 496 static_cast<int>(info->pc() - code->instruction_start()));
499 ASSERT(ast_ids->length() == 0 || 497 ASSERT(ast_ids->length() == 0 ||
500 (*ast_ids)[ast_ids->length()-1] != 498 (*ast_ids)[ast_ids->length()-1] !=
501 static_cast<unsigned>(info->data())); 499 static_cast<unsigned>(info->data()));
502 ast_ids->Add(static_cast<unsigned>(info->data())); 500 ast_ids->Add(static_cast<unsigned>(info->data()));
503 } 501 }
504 } 502 }
505 } 503 }
506 504
507 } } // namespace v8::internal 505 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698