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

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

Issue 71783003: Reland and fix "Add support for keyed-call on arrays of fast elements" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Test + fix Created 7 years, 1 month 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return code->is_keyed_store_stub() && 193 return code->is_keyed_store_stub() &&
194 code->ic_state() == POLYMORPHIC; 194 code->ic_state() == POLYMORPHIC;
195 } 195 }
196 return false; 196 return false;
197 } 197 }
198 198
199 199
200 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { 200 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) {
201 Handle<Object> value = GetInfo(expr->CallFeedbackId()); 201 Handle<Object> value = GetInfo(expr->CallFeedbackId());
202 return value->IsMap() || value->IsAllocationSite() || value->IsJSFunction() || 202 return value->IsMap() || value->IsAllocationSite() || value->IsJSFunction() ||
203 value->IsSmi(); 203 value->IsSmi() ||
204 (value->IsCode() && Handle<Code>::cast(value)->ic_state() == MONOMORPHIC);
204 } 205 }
205 206
206 207
208 bool TypeFeedbackOracle::KeyedArrayCallIsHoley(Call* expr) {
209 Handle<Object> value = GetInfo(expr->CallFeedbackId());
210 Handle<Code> code = Handle<Code>::cast(value);
211 return KeyedArrayCallStub::IsHoley(code);
212 }
213
214
207 bool TypeFeedbackOracle::CallNewIsMonomorphic(CallNew* expr) { 215 bool TypeFeedbackOracle::CallNewIsMonomorphic(CallNew* expr) {
208 Handle<Object> info = GetInfo(expr->CallNewFeedbackId()); 216 Handle<Object> info = GetInfo(expr->CallNewFeedbackId());
209 return info->IsAllocationSite() || info->IsJSFunction(); 217 return info->IsAllocationSite() || info->IsJSFunction();
210 } 218 }
211 219
212 220
213 bool TypeFeedbackOracle::ObjectLiteralStoreIsMonomorphic( 221 bool TypeFeedbackOracle::ObjectLiteralStoreIsMonomorphic(
214 ObjectLiteral::Property* prop) { 222 ObjectLiteral::Property* prop) {
215 Handle<Object> map_or_code = GetInfo(prop->key()->LiteralFeedbackId()); 223 Handle<Object> map_or_code = GetInfo(prop->key()->LiteralFeedbackId());
216 return map_or_code->IsMap(); 224 return map_or_code->IsMap();
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 for (int i = 0; i < infos->length(); i++) { 621 for (int i = 0; i < infos->length(); i++) {
614 RelocInfo reloc_entry = (*infos)[i]; 622 RelocInfo reloc_entry = (*infos)[i];
615 Address target_address = reloc_entry.target_address(); 623 Address target_address = reloc_entry.target_address();
616 TypeFeedbackId ast_id = 624 TypeFeedbackId ast_id =
617 TypeFeedbackId(static_cast<unsigned>((*infos)[i].data())); 625 TypeFeedbackId(static_cast<unsigned>((*infos)[i].data()));
618 Code* target = Code::GetCodeFromTargetAddress(target_address); 626 Code* target = Code::GetCodeFromTargetAddress(target_address);
619 switch (target->kind()) { 627 switch (target->kind()) {
620 case Code::LOAD_IC: 628 case Code::LOAD_IC:
621 case Code::STORE_IC: 629 case Code::STORE_IC:
622 case Code::CALL_IC: 630 case Code::CALL_IC:
623 case Code::KEYED_CALL_IC:
624 if (target->ic_state() == MONOMORPHIC) { 631 if (target->ic_state() == MONOMORPHIC) {
625 if (target->kind() == Code::CALL_IC && 632 if (target->kind() == Code::CALL_IC &&
626 target->check_type() != RECEIVER_MAP_CHECK) { 633 target->check_type() != RECEIVER_MAP_CHECK) {
627 SetInfo(ast_id, Smi::FromInt(target->check_type())); 634 SetInfo(ast_id, Smi::FromInt(target->check_type()));
628 } else { 635 } else {
629 Object* map = target->FindFirstMap(); 636 Object* map = target->FindFirstMap();
630 if (map == NULL) { 637 if (map == NULL) {
631 SetInfo(ast_id, static_cast<Object*>(target)); 638 SetInfo(ast_id, static_cast<Object*>(target));
632 } else if (!CanRetainOtherContext(Map::cast(map), 639 } else if (!CanRetainOtherContext(Map::cast(map),
633 *native_context_)) { 640 *native_context_)) {
634 Map* feedback = Map::cast(map)->CurrentMapForDeprecated(); 641 Map* feedback = Map::cast(map)->CurrentMapForDeprecated();
635 if (feedback != NULL) SetInfo(ast_id, feedback); 642 if (feedback != NULL) SetInfo(ast_id, feedback);
636 } 643 }
637 } 644 }
638 } else { 645 } else {
639 SetInfo(ast_id, target); 646 SetInfo(ast_id, target);
640 } 647 }
641 break; 648 break;
642 649
650 case Code::KEYED_CALL_IC:
643 case Code::KEYED_LOAD_IC: 651 case Code::KEYED_LOAD_IC:
644 case Code::KEYED_STORE_IC: 652 case Code::KEYED_STORE_IC:
645 case Code::BINARY_OP_IC: 653 case Code::BINARY_OP_IC:
646 case Code::COMPARE_IC: 654 case Code::COMPARE_IC:
647 case Code::TO_BOOLEAN_IC: 655 case Code::TO_BOOLEAN_IC:
648 case Code::COMPARE_NIL_IC: 656 case Code::COMPARE_NIL_IC:
649 SetInfo(ast_id, target); 657 SetInfo(ast_id, target);
650 break; 658 break;
651 659
652 default: 660 default:
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 if (info.IsUninitialized()) return Representation::None(); 702 if (info.IsUninitialized()) return Representation::None();
695 if (info.IsSmi()) return Representation::Smi(); 703 if (info.IsSmi()) return Representation::Smi();
696 if (info.IsInteger32()) return Representation::Integer32(); 704 if (info.IsInteger32()) return Representation::Integer32();
697 if (info.IsDouble()) return Representation::Double(); 705 if (info.IsDouble()) return Representation::Double();
698 if (info.IsNumber()) return Representation::Double(); 706 if (info.IsNumber()) return Representation::Double();
699 return Representation::Tagged(); 707 return Representation::Tagged();
700 } 708 }
701 709
702 710
703 } } // namespace v8::internal 711 } } // 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