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

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

Issue 22184004: Desugar bitwise negation into XOR and kill all UnaryOp stuff. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Feedback. Created 7 years, 4 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 CompareIC::StubInfoToType( 377 CompareIC::StubInfoToType(
378 stub_minor_key, left_type, right_type, combined_type, map, isolate()); 378 stub_minor_key, left_type, right_type, combined_type, map, isolate());
379 } else if (code->is_compare_nil_ic_stub()) { 379 } else if (code->is_compare_nil_ic_stub()) {
380 CompareNilICStub stub(code->extended_extra_ic_state()); 380 CompareNilICStub stub(code->extended_extra_ic_state());
381 *combined_type = stub.GetType(isolate_, map); 381 *combined_type = stub.GetType(isolate_, map);
382 *left_type = *right_type = stub.GetInputType(isolate_, map); 382 *left_type = *right_type = stub.GetInputType(isolate_, map);
383 } 383 }
384 } 384 }
385 385
386 386
387 Handle<Type> TypeFeedbackOracle::UnaryType(TypeFeedbackId id) {
388 Handle<Object> object = GetInfo(id);
389 if (!object->IsCode()) {
390 return handle(Type::None(), isolate());
391 }
392 Handle<Code> code = Handle<Code>::cast(object);
393 ASSERT(code->is_unary_op_stub());
394 return UnaryOpStub(code->extended_extra_ic_state()).GetType(isolate());
395 }
396
397
398 void TypeFeedbackOracle::BinaryType(TypeFeedbackId id, 387 void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
399 Handle<Type>* left, 388 Handle<Type>* left,
400 Handle<Type>* right, 389 Handle<Type>* right,
401 Handle<Type>* result, 390 Handle<Type>* result,
402 Maybe<int>* fixed_right_arg) { 391 Maybe<int>* fixed_right_arg) {
403 Handle<Object> object = GetInfo(id); 392 Handle<Object> object = GetInfo(id);
404 if (!object->IsCode()) { 393 if (!object->IsCode()) {
405 // For some binary ops we don't have ICs, e.g. Token::COMMA. 394 // For some binary ops we don't have ICs, e.g. Token::COMMA.
406 *left = *right = *result = handle(Type::None(), isolate_); 395 *left = *right = *result = handle(Type::None(), isolate_);
407 return; 396 return;
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 break; 640 break;
652 641
653 case Code::KEYED_LOAD_IC: 642 case Code::KEYED_LOAD_IC:
654 case Code::KEYED_STORE_IC: 643 case Code::KEYED_STORE_IC:
655 if (target->ic_state() == MONOMORPHIC || 644 if (target->ic_state() == MONOMORPHIC ||
656 target->ic_state() == POLYMORPHIC) { 645 target->ic_state() == POLYMORPHIC) {
657 SetInfo(ast_id, target); 646 SetInfo(ast_id, target);
658 } 647 }
659 break; 648 break;
660 649
661 case Code::UNARY_OP_IC:
662 case Code::BINARY_OP_IC: 650 case Code::BINARY_OP_IC:
663 case Code::COMPARE_IC: 651 case Code::COMPARE_IC:
664 case Code::TO_BOOLEAN_IC: 652 case Code::TO_BOOLEAN_IC:
665 case Code::COMPARE_NIL_IC: 653 case Code::COMPARE_NIL_IC:
666 SetInfo(ast_id, target); 654 SetInfo(ast_id, target);
667 break; 655 break;
668 656
669 default: 657 default:
670 break; 658 break;
671 } 659 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 if (info.IsUninitialized()) return Representation::None(); 699 if (info.IsUninitialized()) return Representation::None();
712 if (info.IsSmi()) return Representation::Smi(); 700 if (info.IsSmi()) return Representation::Smi();
713 if (info.IsInteger32()) return Representation::Integer32(); 701 if (info.IsInteger32()) return Representation::Integer32();
714 if (info.IsDouble()) return Representation::Double(); 702 if (info.IsDouble()) return Representation::Double();
715 if (info.IsNumber()) return Representation::Double(); 703 if (info.IsNumber()) return Representation::Double();
716 return Representation::Tagged(); 704 return Representation::Tagged();
717 } 705 }
718 706
719 707
720 } } // namespace v8::internal 708 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/type-info.h ('k') | src/typing.cc » ('j') | src/x64/lithium-codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698