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

Side by Side Diff: src/ast.cc

Issue 6805005: Fix opmitized external array access for compound assignments (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: final version Created 9 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/ast.h ('k') | src/hydrogen.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2011 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
11 // with the distribution. 11 // with the distribution.
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); 542 ASSERT(lit_key != NULL && lit_key->handle()->IsString());
543 Handle<String> name = Handle<String>::cast(lit_key->handle()); 543 Handle<String> name = Handle<String>::cast(lit_key->handle());
544 ZoneMapList* types = oracle->LoadReceiverTypes(this, name); 544 ZoneMapList* types = oracle->LoadReceiverTypes(this, name);
545 receiver_types_ = types; 545 receiver_types_ = types;
546 } 546 }
547 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { 547 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) {
548 is_string_access_ = true; 548 is_string_access_ = true;
549 } else if (is_monomorphic_) { 549 } else if (is_monomorphic_) {
550 monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this); 550 monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this);
551 if (monomorphic_receiver_type_->has_external_array_elements()) { 551 if (monomorphic_receiver_type_->has_external_array_elements()) {
552 SetExternalArrayType(oracle->GetKeyedLoadExternalArrayType(this)); 552 set_external_array_type(oracle->GetKeyedLoadExternalArrayType(this));
553 } 553 }
554 } 554 }
555 } 555 }
556 556
557 557
558 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) { 558 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
559 Property* prop = target()->AsProperty(); 559 Property* prop = target()->AsProperty();
560 ASSERT(prop != NULL); 560 ASSERT(prop != NULL);
561 is_monomorphic_ = oracle->StoreIsMonomorphic(this); 561 is_monomorphic_ = oracle->StoreIsMonomorphic(this);
562 if (prop->key()->IsPropertyName()) { 562 if (prop->key()->IsPropertyName()) {
563 Literal* lit_key = prop->key()->AsLiteral(); 563 Literal* lit_key = prop->key()->AsLiteral();
564 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); 564 ASSERT(lit_key != NULL && lit_key->handle()->IsString());
565 Handle<String> name = Handle<String>::cast(lit_key->handle()); 565 Handle<String> name = Handle<String>::cast(lit_key->handle());
566 ZoneMapList* types = oracle->StoreReceiverTypes(this, name); 566 ZoneMapList* types = oracle->StoreReceiverTypes(this, name);
567 receiver_types_ = types; 567 receiver_types_ = types;
568 } else if (is_monomorphic_) { 568 } else if (is_monomorphic_) {
569 // Record receiver type for monomorphic keyed loads. 569 // Record receiver type for monomorphic keyed loads.
570 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); 570 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this);
571 if (monomorphic_receiver_type_->has_external_array_elements()) { 571 if (monomorphic_receiver_type_->has_external_array_elements()) {
572 SetExternalArrayType(oracle->GetKeyedStoreExternalArrayType(this)); 572 set_external_array_type(oracle->GetKeyedStoreExternalArrayType(this));
573 } 573 }
574 } 574 }
575 } 575 }
576
577
578 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
579 is_monomorphic_ = oracle->StoreIsMonomorphic(this);
580 if (is_monomorphic_) {
581 // Record receiver type for monomorphic keyed loads.
582 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this);
583 if (monomorphic_receiver_type_->has_external_array_elements()) {
584 set_external_array_type(oracle->GetKeyedStoreExternalArrayType(this));
585 }
586 }
587 }
576 588
577 589
578 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { 590 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
579 TypeInfo info = oracle->SwitchType(this); 591 TypeInfo info = oracle->SwitchType(this);
580 if (info.IsSmi()) { 592 if (info.IsSmi()) {
581 compare_type_ = SMI_ONLY; 593 compare_type_ = SMI_ONLY;
582 } else if (info.IsNonPrimitive()) { 594 } else if (info.IsNonPrimitive()) {
583 compare_type_ = OBJECT_ONLY; 595 compare_type_ = OBJECT_ONLY;
584 } else { 596 } else {
585 ASSERT(compare_type_ == NONE); 597 ASSERT(compare_type_ == NONE);
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 ZoneList<Statement*>* statements, 1081 ZoneList<Statement*>* statements,
1070 int pos) 1082 int pos)
1071 : label_(label), 1083 : label_(label),
1072 statements_(statements), 1084 statements_(statements),
1073 position_(pos), 1085 position_(pos),
1074 compare_type_(NONE), 1086 compare_type_(NONE),
1075 entry_id_(AstNode::GetNextId()) { 1087 entry_id_(AstNode::GetNextId()) {
1076 } 1088 }
1077 1089
1078 } } // namespace v8::internal 1090 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698