| OLD | NEW |
| 1 // Copyright 2011 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 |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 bool CountOperation::IsInlineable() const { | 580 bool CountOperation::IsInlineable() const { |
| 581 return expression()->IsInlineable(); | 581 return expression()->IsInlineable(); |
| 582 } | 582 } |
| 583 | 583 |
| 584 | 584 |
| 585 // ---------------------------------------------------------------------------- | 585 // ---------------------------------------------------------------------------- |
| 586 // Recording of type feedback | 586 // Recording of type feedback |
| 587 | 587 |
| 588 void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 588 void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 589 // Record type feedback from the oracle in the AST. | 589 // Record type feedback from the oracle in the AST. |
| 590 is_monomorphic_ = oracle->LoadIsMonomorphic(this); | 590 is_monomorphic_ = oracle->LoadIsMonomorphicNormal(this); |
| 591 if (key()->IsPropertyName()) { | 591 if (key()->IsPropertyName()) { |
| 592 if (oracle->LoadIsBuiltin(this, Builtins::kLoadIC_ArrayLength)) { | 592 if (oracle->LoadIsBuiltin(this, Builtins::kLoadIC_ArrayLength)) { |
| 593 is_array_length_ = true; | 593 is_array_length_ = true; |
| 594 } else if (oracle->LoadIsBuiltin(this, Builtins::kLoadIC_StringLength)) { | 594 } else if (oracle->LoadIsBuiltin(this, Builtins::kLoadIC_StringLength)) { |
| 595 is_string_length_ = true; | 595 is_string_length_ = true; |
| 596 } else if (oracle->LoadIsBuiltin(this, | 596 } else if (oracle->LoadIsBuiltin(this, |
| 597 Builtins::kLoadIC_FunctionPrototype)) { | 597 Builtins::kLoadIC_FunctionPrototype)) { |
| 598 is_function_prototype_ = true; | 598 is_function_prototype_ = true; |
| 599 } else { | 599 } else { |
| 600 Literal* lit_key = key()->AsLiteral(); | 600 Literal* lit_key = key()->AsLiteral(); |
| 601 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); | 601 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); |
| 602 Handle<String> name = Handle<String>::cast(lit_key->handle()); | 602 Handle<String> name = Handle<String>::cast(lit_key->handle()); |
| 603 ZoneMapList* types = oracle->LoadReceiverTypes(this, name); | 603 ZoneMapList* types = oracle->LoadReceiverTypes(this, name); |
| 604 receiver_types_ = types; | 604 receiver_types_ = types; |
| 605 } | 605 } |
| 606 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { | 606 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { |
| 607 is_string_access_ = true; | 607 is_string_access_ = true; |
| 608 } else if (is_monomorphic_) { | 608 } else if (is_monomorphic_) { |
| 609 monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this); | 609 monomorphic_receiver_type_ = oracle->LoadMonomorphicReceiverType(this); |
| 610 } | 610 } |
| 611 } | 611 } |
| 612 | 612 |
| 613 | 613 |
| 614 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 614 void Assignment::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 615 Property* prop = target()->AsProperty(); | 615 Property* prop = target()->AsProperty(); |
| 616 ASSERT(prop != NULL); | 616 ASSERT(prop != NULL); |
| 617 is_monomorphic_ = oracle->StoreIsMonomorphic(this); | 617 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); |
| 618 if (prop->key()->IsPropertyName()) { | 618 if (prop->key()->IsPropertyName()) { |
| 619 Literal* lit_key = prop->key()->AsLiteral(); | 619 Literal* lit_key = prop->key()->AsLiteral(); |
| 620 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); | 620 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); |
| 621 Handle<String> name = Handle<String>::cast(lit_key->handle()); | 621 Handle<String> name = Handle<String>::cast(lit_key->handle()); |
| 622 ZoneMapList* types = oracle->StoreReceiverTypes(this, name); | 622 ZoneMapList* types = oracle->StoreReceiverTypes(this, name); |
| 623 receiver_types_ = types; | 623 receiver_types_ = types; |
| 624 } else if (is_monomorphic_) { | 624 } else if (is_monomorphic_) { |
| 625 // Record receiver type for monomorphic keyed loads. | 625 // Record receiver type for monomorphic keyed loads. |
| 626 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); | 626 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); |
| 627 } | 627 } |
| 628 } | 628 } |
| 629 | 629 |
| 630 | 630 |
| 631 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 631 void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 632 is_monomorphic_ = oracle->StoreIsMonomorphic(this); | 632 is_monomorphic_ = oracle->StoreIsMonomorphicNormal(this); |
| 633 if (is_monomorphic_) { | 633 if (is_monomorphic_) { |
| 634 // Record receiver type for monomorphic keyed loads. | 634 // Record receiver type for monomorphic keyed loads. |
| 635 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); | 635 monomorphic_receiver_type_ = oracle->StoreMonomorphicReceiverType(this); |
| 636 } | 636 } |
| 637 } | 637 } |
| 638 | 638 |
| 639 | 639 |
| 640 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | 640 void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) { |
| 641 TypeInfo info = oracle->SwitchType(this); | 641 TypeInfo info = oracle->SwitchType(this); |
| 642 if (info.IsSmi()) { | 642 if (info.IsSmi()) { |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 int pos) | 1153 int pos) |
| 1154 : label_(label), | 1154 : label_(label), |
| 1155 statements_(statements), | 1155 statements_(statements), |
| 1156 position_(pos), | 1156 position_(pos), |
| 1157 compare_type_(NONE), | 1157 compare_type_(NONE), |
| 1158 compare_id_(AstNode::GetNextId()), | 1158 compare_id_(AstNode::GetNextId()), |
| 1159 entry_id_(AstNode::GetNextId()) { | 1159 entry_id_(AstNode::GetNextId()) { |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 } } // namespace v8::internal | 1162 } } // namespace v8::internal |
| OLD | NEW |