| OLD | NEW |
| 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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 case BOOLEAN_CHECK: | 690 case BOOLEAN_CHECK: |
| 691 function = native_context->boolean_function(); | 691 function = native_context->boolean_function(); |
| 692 break; | 692 break; |
| 693 } | 693 } |
| 694 ASSERT(function != NULL); | 694 ASSERT(function != NULL); |
| 695 return Handle<JSObject>(JSObject::cast(function->instance_prototype())); | 695 return Handle<JSObject>(JSObject::cast(function->instance_prototype())); |
| 696 } | 696 } |
| 697 | 697 |
| 698 | 698 |
| 699 void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle, | 699 void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle, |
| 700 CallKind call_kind) { | 700 ContextualMode contextual_mode) { |
| 701 is_monomorphic_ = oracle->CallIsMonomorphic(CallFeedbackId()); | 701 is_monomorphic_ = oracle->CallIsMonomorphic(CallFeedbackId()); |
| 702 Property* property = expression()->AsProperty(); | 702 Property* property = expression()->AsProperty(); |
| 703 if (property == NULL) { | 703 if (property == NULL) { |
| 704 // Function call. Specialize for monomorphic calls. | 704 // Function call. Specialize for monomorphic calls. |
| 705 if (is_monomorphic_) target_ = oracle->GetCallTarget(CallFeedbackId()); | 705 if (is_monomorphic_) target_ = oracle->GetCallTarget(CallFeedbackId()); |
| 706 } else if (property->key()->IsPropertyName()) { | 706 } else if (property->key()->IsPropertyName()) { |
| 707 // Method call. Specialize for the receiver types seen at runtime. | 707 // Method call. Specialize for the receiver types seen at runtime. |
| 708 Literal* key = property->key()->AsLiteral(); | 708 Literal* key = property->key()->AsLiteral(); |
| 709 ASSERT(key != NULL && key->value()->IsString()); | 709 ASSERT(key != NULL && key->value()->IsString()); |
| 710 Handle<String> name = Handle<String>::cast(key->value()); | 710 Handle<String> name = Handle<String>::cast(key->value()); |
| 711 check_type_ = oracle->GetCallCheckType(CallFeedbackId()); | 711 check_type_ = oracle->GetCallCheckType(CallFeedbackId()); |
| 712 receiver_types_.Clear(); | 712 receiver_types_.Clear(); |
| 713 if (check_type_ == RECEIVER_MAP_CHECK) { | 713 if (check_type_ == RECEIVER_MAP_CHECK) { |
| 714 oracle->CallReceiverTypes(CallFeedbackId(), | 714 oracle->CallReceiverTypes(CallFeedbackId(), |
| 715 name, arguments()->length(), call_kind, &receiver_types_); | 715 name, arguments()->length(), contextual_mode, &receiver_types_); |
| 716 is_monomorphic_ = is_monomorphic_ && receiver_types_.length() > 0; | 716 is_monomorphic_ = is_monomorphic_ && receiver_types_.length() > 0; |
| 717 } else { | 717 } else { |
| 718 holder_ = GetPrototypeForPrimitiveCheck(check_type_, oracle->isolate()); | 718 holder_ = GetPrototypeForPrimitiveCheck(check_type_, oracle->isolate()); |
| 719 receiver_types_.Add(handle(holder_->map()), oracle->zone()); | 719 receiver_types_.Add(handle(holder_->map()), oracle->zone()); |
| 720 } | 720 } |
| 721 #ifdef ENABLE_SLOW_ASSERTS | 721 #ifdef ENABLE_SLOW_ASSERTS |
| 722 if (FLAG_enable_slow_asserts) { | 722 if (FLAG_enable_slow_asserts) { |
| 723 int length = receiver_types_.length(); | 723 int length = receiver_types_.length(); |
| 724 for (int i = 0; i < length; i++) { | 724 for (int i = 0; i < length; i++) { |
| 725 Handle<Map> map = receiver_types_.at(i); | 725 Handle<Map> map = receiver_types_.at(i); |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); | 1262 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); |
| 1263 str = arr; | 1263 str = arr; |
| 1264 } else { | 1264 } else { |
| 1265 str = DoubleToCString(value_->Number(), buffer); | 1265 str = DoubleToCString(value_->Number(), buffer); |
| 1266 } | 1266 } |
| 1267 return isolate_->factory()->NewStringFromAscii(CStrVector(str)); | 1267 return isolate_->factory()->NewStringFromAscii(CStrVector(str)); |
| 1268 } | 1268 } |
| 1269 | 1269 |
| 1270 | 1270 |
| 1271 } } // namespace v8::internal | 1271 } } // namespace v8::internal |
| OLD | NEW |