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

Side by Side Diff: src/type-info.cc

Issue 6880276: Use type info for count operation in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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
« src/hydrogen.cc ('K') | « src/type-info.h ('k') | no next file » | 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 case CompareIC::OBJECTS: 308 case CompareIC::OBJECTS:
309 // TODO(kasperl): We really need a type for JS objects here. 309 // TODO(kasperl): We really need a type for JS objects here.
310 return TypeInfo::NonPrimitive(); 310 return TypeInfo::NonPrimitive();
311 case CompareIC::GENERIC: 311 case CompareIC::GENERIC:
312 default: 312 default:
313 return unknown; 313 return unknown;
314 } 314 }
315 } 315 }
316 316
317 317
318 TypeInfo TypeFeedbackOracle::IncrementType(CountOperation* expr) {
319 Handle<Object> object = GetInfo(expr->CountId());
320 TypeInfo unknown = TypeInfo::Unknown();
321 if (!object->IsCode()) return unknown;
322 Handle<Code> code = Handle<Code>::cast(object);
323 if (!code->is_type_recording_binary_op_stub()) return unknown;
324
325 TRBinaryOpIC::TypeInfo type = static_cast<TRBinaryOpIC::TypeInfo>(
326 code->type_recording_binary_op_type());
327 switch (type) {
328 case TRBinaryOpIC::UNINITIALIZED:
329 case TRBinaryOpIC::SMI:
330 return TypeInfo::Smi();
331 case TRBinaryOpIC::INT32:
332 return TypeInfo::Integer32();
333 case TRBinaryOpIC::HEAP_NUMBER:
334 return TypeInfo::Double();
335 case TRBinaryOpIC::BOTH_STRING:
336 case TRBinaryOpIC::STRING:
337 case TRBinaryOpIC::GENERIC:
338 return unknown;
339 default:
340 return unknown;
341 }
342 UNREACHABLE();
fschneider 2011/04/29 08:56:22 Maybe no need for UNREACHABLE() and the following
William Hesse 2011/04/29 09:20:34 I think there is a MacOS compiler that can't handl
343 return unknown;
344 }
345
346
318 ZoneMapList* TypeFeedbackOracle::CollectReceiverTypes(unsigned ast_id, 347 ZoneMapList* TypeFeedbackOracle::CollectReceiverTypes(unsigned ast_id,
319 Handle<String> name, 348 Handle<String> name,
320 Code::Flags flags) { 349 Code::Flags flags) {
321 Isolate* isolate = Isolate::Current(); 350 Isolate* isolate = Isolate::Current();
322 Handle<Object> object = GetInfo(ast_id); 351 Handle<Object> object = GetInfo(ast_id);
323 if (object->IsUndefined() || object->IsSmi()) return NULL; 352 if (object->IsUndefined() || object->IsSmi()) return NULL;
324 353
325 if (*object == isolate->builtins()->builtin(Builtins::kStoreIC_GlobalProxy)) { 354 if (*object == isolate->builtins()->builtin(Builtins::kStoreIC_GlobalProxy)) {
326 // TODO(fschneider): We could collect the maps and signal that 355 // TODO(fschneider): We could collect the maps and signal that
327 // we need a generic store (or load) here. 356 // we need a generic store (or load) here.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 static_cast<int>(info->pc() - code->instruction_start())); 464 static_cast<int>(info->pc() - code->instruction_start()));
436 ASSERT(ast_ids->length() == 0 || 465 ASSERT(ast_ids->length() == 0 ||
437 (*ast_ids)[ast_ids->length()-1] != 466 (*ast_ids)[ast_ids->length()-1] !=
438 static_cast<unsigned>(info->data())); 467 static_cast<unsigned>(info->data()));
439 ast_ids->Add(static_cast<unsigned>(info->data())); 468 ast_ids->Add(static_cast<unsigned>(info->data()));
440 } 469 }
441 } 470 }
442 } 471 }
443 472
444 } } // namespace v8::internal 473 } } // namespace v8::internal
OLDNEW
« src/hydrogen.cc ('K') | « src/type-info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698