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

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

Issue 22715004: Version 3.20.15 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Add TypedArray API and correctness patches r16033 and r16084 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
« no previous file with comments | « src/type-info.h ('k') | src/typing.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 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
387 void TypeFeedbackOracle::BinaryType(TypeFeedbackId id, 398 void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
388 Handle<Type>* left, 399 Handle<Type>* left,
389 Handle<Type>* right, 400 Handle<Type>* right,
390 Handle<Type>* result, 401 Handle<Type>* result,
391 Maybe<int>* fixed_right_arg) { 402 Maybe<int>* fixed_right_arg) {
392 Handle<Object> object = GetInfo(id); 403 Handle<Object> object = GetInfo(id);
393 if (!object->IsCode()) { 404 if (!object->IsCode()) {
394 // For some binary ops we don't have ICs, e.g. Token::COMMA. 405 // For some binary ops we don't have ICs, e.g. Token::COMMA.
395 *left = *right = *result = handle(Type::None(), isolate_); 406 *left = *right = *result = handle(Type::None(), isolate_);
396 return; 407 return;
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 break; 651 break;
641 652
642 case Code::KEYED_LOAD_IC: 653 case Code::KEYED_LOAD_IC:
643 case Code::KEYED_STORE_IC: 654 case Code::KEYED_STORE_IC:
644 if (target->ic_state() == MONOMORPHIC || 655 if (target->ic_state() == MONOMORPHIC ||
645 target->ic_state() == POLYMORPHIC) { 656 target->ic_state() == POLYMORPHIC) {
646 SetInfo(ast_id, target); 657 SetInfo(ast_id, target);
647 } 658 }
648 break; 659 break;
649 660
661 case Code::UNARY_OP_IC:
650 case Code::BINARY_OP_IC: 662 case Code::BINARY_OP_IC:
651 case Code::COMPARE_IC: 663 case Code::COMPARE_IC:
652 case Code::TO_BOOLEAN_IC: 664 case Code::TO_BOOLEAN_IC:
653 case Code::COMPARE_NIL_IC: 665 case Code::COMPARE_NIL_IC:
654 SetInfo(ast_id, target); 666 SetInfo(ast_id, target);
655 break; 667 break;
656 668
657 default: 669 default:
658 break; 670 break;
659 } 671 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 if (info.IsUninitialized()) return Representation::None(); 711 if (info.IsUninitialized()) return Representation::None();
700 if (info.IsSmi()) return Representation::Smi(); 712 if (info.IsSmi()) return Representation::Smi();
701 if (info.IsInteger32()) return Representation::Integer32(); 713 if (info.IsInteger32()) return Representation::Integer32();
702 if (info.IsDouble()) return Representation::Double(); 714 if (info.IsDouble()) return Representation::Double();
703 if (info.IsNumber()) return Representation::Double(); 715 if (info.IsNumber()) return Representation::Double();
704 return Representation::Tagged(); 716 return Representation::Tagged();
705 } 717 }
706 718
707 719
708 } } // namespace v8::internal 720 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/type-info.h ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698