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

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

Issue 14081008: Type feedback for Unary Plus (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« no previous file with comments | « 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 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 case BinaryOpIC::NUMBER: return TypeInfo::Double(); 451 case BinaryOpIC::NUMBER: return TypeInfo::Double();
452 case BinaryOpIC::ODDBALL: return TypeInfo::Unknown(); 452 case BinaryOpIC::ODDBALL: return TypeInfo::Unknown();
453 case BinaryOpIC::STRING: return TypeInfo::String(); 453 case BinaryOpIC::STRING: return TypeInfo::String();
454 case BinaryOpIC::GENERIC: return TypeInfo::Unknown(); 454 case BinaryOpIC::GENERIC: return TypeInfo::Unknown();
455 } 455 }
456 UNREACHABLE(); 456 UNREACHABLE();
457 return TypeInfo::Unknown(); 457 return TypeInfo::Unknown();
458 } 458 }
459 459
460 460
461 void TypeFeedbackOracle::BinaryType(BinaryOperation* expr, 461 void TypeFeedbackOracle::BinaryType(TypeFeedbackId type_feedback_id,
462 TypeInfo* left, 462 TypeInfo* left,
463 TypeInfo* right, 463 TypeInfo* right,
464 TypeInfo* result) { 464 TypeInfo* result) {
465 Handle<Object> object = GetInfo(expr->BinaryOperationFeedbackId()); 465 Handle<Object> object = GetInfo(type_feedback_id);
466 TypeInfo unknown = TypeInfo::Unknown(); 466 TypeInfo unknown = TypeInfo::Unknown();
467 if (!object->IsCode()) { 467 if (!object->IsCode()) {
468 *left = *right = *result = unknown; 468 *left = *right = *result = unknown;
469 return; 469 return;
470 } 470 }
471 Handle<Code> code = Handle<Code>::cast(object); 471 Handle<Code> code = Handle<Code>::cast(object);
472 if (code->is_binary_op_stub()) { 472 if (code->is_binary_op_stub()) {
473 BinaryOpIC::TypeInfo left_type, right_type, result_type; 473 BinaryOpIC::TypeInfo left_type, right_type, result_type;
474 BinaryOpStub::decode_types_from_minor_key(code->stub_info(), &left_type, 474 BinaryOpStub::decode_types_from_minor_key(code->stub_info(), &left_type,
475 &right_type, &result_type); 475 &right_type, &result_type);
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 USE(maybe_result); 759 USE(maybe_result);
760 #ifdef DEBUG 760 #ifdef DEBUG
761 Object* result = NULL; 761 Object* result = NULL;
762 // Dictionary has been allocated with sufficient size for all elements. 762 // Dictionary has been allocated with sufficient size for all elements.
763 ASSERT(maybe_result->ToObject(&result)); 763 ASSERT(maybe_result->ToObject(&result));
764 ASSERT(*dictionary_ == result); 764 ASSERT(*dictionary_ == result);
765 #endif 765 #endif
766 } 766 }
767 767
768 } } // namespace v8::internal 768 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/type-info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698