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

Side by Side Diff: src/ast.cc

Issue 12221064: Implement many KeyedStoreStubs using Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Final review feedback Created 7 years, 9 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/ast.h ('k') | src/code-stubs.h » ('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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 Expression* target, 121 Expression* target,
122 Expression* value, 122 Expression* value,
123 int pos) 123 int pos)
124 : Expression(isolate), 124 : Expression(isolate),
125 op_(op), 125 op_(op),
126 target_(target), 126 target_(target),
127 value_(value), 127 value_(value),
128 pos_(pos), 128 pos_(pos),
129 binary_operation_(NULL), 129 binary_operation_(NULL),
130 assignment_id_(GetNextId(isolate)), 130 assignment_id_(GetNextId(isolate)),
131 is_monomorphic_(false) { } 131 is_monomorphic_(false),
132 store_mode_(STANDARD_STORE) { }
132 133
133 134
134 Token::Value Assignment::binary_op() const { 135 Token::Value Assignment::binary_op() const {
135 switch (op_) { 136 switch (op_) {
136 case Token::ASSIGN_BIT_OR: return Token::BIT_OR; 137 case Token::ASSIGN_BIT_OR: return Token::BIT_OR;
137 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR; 138 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR;
138 case Token::ASSIGN_BIT_AND: return Token::BIT_AND; 139 case Token::ASSIGN_BIT_AND: return Token::BIT_AND;
139 case Token::ASSIGN_SHL: return Token::SHL; 140 case Token::ASSIGN_SHL: return Token::SHL;
140 case Token::ASSIGN_SAR: return Token::SAR; 141 case Token::ASSIGN_SAR: return Token::SAR;
141 case Token::ASSIGN_SHR: return Token::SHR; 142 case Token::ASSIGN_SHR: return Token::SHR;
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id); 449 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id);
449 receiver_types_.Clear(); 450 receiver_types_.Clear();
450 if (prop->key()->IsPropertyName()) { 451 if (prop->key()->IsPropertyName()) {
451 Literal* lit_key = prop->key()->AsLiteral(); 452 Literal* lit_key = prop->key()->AsLiteral();
452 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); 453 ASSERT(lit_key != NULL && lit_key->handle()->IsString());
453 Handle<String> name = Handle<String>::cast(lit_key->handle()); 454 Handle<String> name = Handle<String>::cast(lit_key->handle());
454 oracle->StoreReceiverTypes(this, name, &receiver_types_); 455 oracle->StoreReceiverTypes(this, name, &receiver_types_);
455 } else if (is_monomorphic_) { 456 } else if (is_monomorphic_) {
456 // Record receiver type for monomorphic keyed stores. 457 // Record receiver type for monomorphic keyed stores.
457 receiver_types_.Add(oracle->StoreMonomorphicReceiverType(id), zone); 458 receiver_types_.Add(oracle->StoreMonomorphicReceiverType(id), zone);
459 store_mode_ = oracle->GetStoreMode(id);
458 } else if (oracle->StoreIsPolymorphic(id)) { 460 } else if (oracle->StoreIsPolymorphic(id)) {
459 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); 461 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
460 oracle->CollectKeyedReceiverTypes(id, &receiver_types_); 462 oracle->CollectKeyedReceiverTypes(id, &receiver_types_);
463 store_mode_ = oracle->GetStoreMode(id);
461 } 464 }
462 } 465 }
463 466
464 467
465 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle, 468 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle,
466 Zone* zone) { 469 Zone* zone) {
467 TypeFeedbackId id = CountStoreFeedbackId(); 470 TypeFeedbackId id = CountStoreFeedbackId();
468 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id); 471 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(id);
469 receiver_types_.Clear(); 472 receiver_types_.Clear();
470 if (is_monomorphic_) { 473 if (is_monomorphic_) {
471 // Record receiver type for monomorphic keyed stores. 474 // Record receiver type for monomorphic keyed stores.
472 receiver_types_.Add( 475 receiver_types_.Add(
473 oracle->StoreMonomorphicReceiverType(id), zone); 476 oracle->StoreMonomorphicReceiverType(id), zone);
474 } else if (oracle->StoreIsPolymorphic(id)) { 477 } else if (oracle->StoreIsPolymorphic(id)) {
475 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone); 478 receiver_types_.Reserve(kMaxKeyedPolymorphism, zone);
476 oracle->CollectKeyedReceiverTypes(id, &receiver_types_); 479 oracle->CollectKeyedReceiverTypes(id, &receiver_types_);
477 } 480 }
481 store_mode_ = oracle->GetStoreMode(id);
478 } 482 }
479 483
480 484
481 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { 485 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
482 TypeInfo info = oracle->SwitchType(this); 486 TypeInfo info = oracle->SwitchType(this);
483 if (info.IsUninitialized()) info = TypeInfo::Unknown(); 487 if (info.IsUninitialized()) info = TypeInfo::Unknown();
484 if (info.IsSmi()) { 488 if (info.IsSmi()) {
485 compare_type_ = SMI_ONLY; 489 compare_type_ = SMI_ONLY;
486 } else if (info.IsInternalizedString()) { 490 } else if (info.IsInternalizedString()) {
487 compare_type_ = NAME_ONLY; 491 compare_type_ = NAME_ONLY;
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value()); 1112 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value());
1109 str = arr; 1113 str = arr;
1110 } else { 1114 } else {
1111 str = DoubleToCString(handle_->Number(), buffer); 1115 str = DoubleToCString(handle_->Number(), buffer);
1112 } 1116 }
1113 return FACTORY->NewStringFromAscii(CStrVector(str)); 1117 return FACTORY->NewStringFromAscii(CStrVector(str));
1114 } 1118 }
1115 1119
1116 1120
1117 } } // namespace v8::internal 1121 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698