| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 #ifdef DEBUG | 141 #ifdef DEBUG |
| 142 StackFrameIterator it(isolate); | 142 StackFrameIterator it(isolate); |
| 143 for (int i = 0; i < depth + 1; i++) it.Advance(); | 143 for (int i = 0; i < depth + 1; i++) it.Advance(); |
| 144 StackFrame* frame = it.frame(); | 144 StackFrame* frame = it.frame(); |
| 145 ASSERT(fp == frame->fp() && pc_address == frame->pc_address()); | 145 ASSERT(fp == frame->fp() && pc_address == frame->pc_address()); |
| 146 #endif | 146 #endif |
| 147 fp_ = fp; | 147 fp_ = fp; |
| 148 pc_address_ = StackFrame::ResolveReturnAddressLocation(pc_address); | 148 pc_address_ = StackFrame::ResolveReturnAddressLocation(pc_address); |
| 149 target_ = handle(raw_target(), isolate); | 149 target_ = handle(raw_target(), isolate); |
| 150 state_ = target_->ic_state(); | 150 state_ = target_->ic_state(); |
| 151 extra_ic_state_ = target_->extra_ic_state(); | 151 extra_ic_state_ = target_->needs_extended_extra_ic_state(target_->kind()) |
| 152 ? target_->extended_extra_ic_state() |
| 153 : target_->extra_ic_state(); |
| 152 } | 154 } |
| 153 | 155 |
| 154 | 156 |
| 155 #ifdef ENABLE_DEBUGGER_SUPPORT | 157 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 156 Address IC::OriginalCodeAddress() const { | 158 Address IC::OriginalCodeAddress() const { |
| 157 HandleScope scope(isolate()); | 159 HandleScope scope(isolate()); |
| 158 // Compute the JavaScript frame for the frame pointer of this IC | 160 // Compute the JavaScript frame for the frame pointer of this IC |
| 159 // structure. We need this to be able to find the function | 161 // structure. We need this to be able to find the function |
| 160 // corresponding to the frame. | 162 // corresponding to the frame. |
| 161 StackFrameIterator it(isolate()); | 163 StackFrameIterator it(isolate()); |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 | 638 |
| 637 number_of_valid_types++; | 639 number_of_valid_types++; |
| 638 if (handler_to_overwrite >= 0) { | 640 if (handler_to_overwrite >= 0) { |
| 639 handlers.Set(handler_to_overwrite, code); | 641 handlers.Set(handler_to_overwrite, code); |
| 640 } else { | 642 } else { |
| 641 types.Add(type); | 643 types.Add(type); |
| 642 handlers.Add(code); | 644 handlers.Add(code); |
| 643 } | 645 } |
| 644 | 646 |
| 645 Handle<Code> ic = isolate()->stub_cache()->ComputePolymorphicIC( | 647 Handle<Code> ic = isolate()->stub_cache()->ComputePolymorphicIC( |
| 646 kind(), &types, &handlers, number_of_valid_types, name, extra_ic_state()); | 648 &types, &handlers, number_of_valid_types, name, extra_ic_state()); |
| 647 set_target(*ic); | 649 set_target(*ic); |
| 648 return true; | 650 return true; |
| 649 } | 651 } |
| 650 | 652 |
| 651 | 653 |
| 652 Handle<HeapType> IC::CurrentTypeOf(Handle<Object> object, Isolate* isolate) { | 654 Handle<HeapType> IC::CurrentTypeOf(Handle<Object> object, Isolate* isolate) { |
| 653 return object->IsJSGlobalObject() | 655 return object->IsJSGlobalObject() |
| 654 ? HeapType::Constant(Handle<JSGlobalObject>::cast(object), isolate) | 656 ? HeapType::Constant(Handle<JSGlobalObject>::cast(object), isolate) |
| 655 : HeapType::OfCurrently(object, isolate); | 657 : HeapType::OfCurrently(object, isolate); |
| 656 } | 658 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 | 690 |
| 689 template | 691 template |
| 690 Handle<HeapType> IC::MapToType<HeapType>(Handle<Map> map, Isolate* region); | 692 Handle<HeapType> IC::MapToType<HeapType>(Handle<Map> map, Isolate* region); |
| 691 | 693 |
| 692 | 694 |
| 693 void IC::UpdateMonomorphicIC(Handle<HeapType> type, | 695 void IC::UpdateMonomorphicIC(Handle<HeapType> type, |
| 694 Handle<Code> handler, | 696 Handle<Code> handler, |
| 695 Handle<String> name) { | 697 Handle<String> name) { |
| 696 if (!handler->is_handler()) return set_target(*handler); | 698 if (!handler->is_handler()) return set_target(*handler); |
| 697 Handle<Code> ic = isolate()->stub_cache()->ComputeMonomorphicIC( | 699 Handle<Code> ic = isolate()->stub_cache()->ComputeMonomorphicIC( |
| 698 kind(), name, type, handler, extra_ic_state()); | 700 name, type, handler, extra_ic_state()); |
| 699 set_target(*ic); | 701 set_target(*ic); |
| 700 } | 702 } |
| 701 | 703 |
| 702 | 704 |
| 703 void IC::CopyICToMegamorphicCache(Handle<String> name) { | 705 void IC::CopyICToMegamorphicCache(Handle<String> name) { |
| 704 TypeHandleList types; | 706 TypeHandleList types; |
| 705 CodeHandleList handlers; | 707 CodeHandleList handlers; |
| 706 target()->FindAllTypes(&types); | 708 target()->FindAllTypes(&types); |
| 707 if (!target()->FindHandlers(&handlers, types.length())) return; | 709 if (!target()->FindHandlers(&handlers, types.length())) return; |
| 708 for (int i = 0; i < types.length(); i++) { | 710 for (int i = 0; i < types.length(); i++) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 | 840 |
| 839 Handle<Code> IC::ComputeHandler(LookupResult* lookup, | 841 Handle<Code> IC::ComputeHandler(LookupResult* lookup, |
| 840 Handle<Object> object, | 842 Handle<Object> object, |
| 841 Handle<String> name, | 843 Handle<String> name, |
| 842 Handle<Object> value) { | 844 Handle<Object> value) { |
| 843 InlineCacheHolderFlag cache_holder = GetCodeCacheForObject(*object); | 845 InlineCacheHolderFlag cache_holder = GetCodeCacheForObject(*object); |
| 844 Handle<HeapObject> stub_holder(GetCodeCacheHolder( | 846 Handle<HeapObject> stub_holder(GetCodeCacheHolder( |
| 845 isolate(), *object, cache_holder)); | 847 isolate(), *object, cache_holder)); |
| 846 | 848 |
| 847 Handle<Code> code = isolate()->stub_cache()->FindHandler( | 849 Handle<Code> code = isolate()->stub_cache()->FindHandler( |
| 848 name, handle(stub_holder->map()), kind(), cache_holder, | 850 name, handle(stub_holder->map()), kind(), cache_holder); |
| 849 lookup->holder()->HasFastProperties() ? Code::FAST : Code::NORMAL); | 851 if (!code.is_null()) return code; |
| 850 if (!code.is_null()) { | |
| 851 return code; | |
| 852 } | |
| 853 | 852 |
| 854 code = CompileHandler(lookup, object, name, value, cache_holder); | 853 code = CompileHandler(lookup, object, name, value, cache_holder); |
| 855 ASSERT(code->is_handler()); | 854 ASSERT(code->is_handler()); |
| 856 | 855 |
| 857 if (code->type() != Code::NORMAL) { | 856 if (code->type() != Code::NORMAL) { |
| 858 HeapObject::UpdateMapCodeCache(stub_holder, name, code); | 857 HeapObject::UpdateMapCodeCache(stub_holder, name, code); |
| 859 } | 858 } |
| 860 | 859 |
| 861 return code; | 860 return code; |
| 862 } | 861 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 | 1056 |
| 1058 | 1057 |
| 1059 MaybeObject* KeyedLoadIC::Load(Handle<Object> object, Handle<Object> key) { | 1058 MaybeObject* KeyedLoadIC::Load(Handle<Object> object, Handle<Object> key) { |
| 1060 if (MigrateDeprecated(object)) { | 1059 if (MigrateDeprecated(object)) { |
| 1061 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); | 1060 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); |
| 1062 } | 1061 } |
| 1063 | 1062 |
| 1064 MaybeObject* maybe_object = NULL; | 1063 MaybeObject* maybe_object = NULL; |
| 1065 Handle<Code> stub = generic_stub(); | 1064 Handle<Code> stub = generic_stub(); |
| 1066 | 1065 |
| 1067 // Check for non-string values that can be converted into an | 1066 // Check for values that can be converted into an internalized string directly |
| 1068 // internalized string directly or is representable as a smi. | 1067 // or is representable as a smi. |
| 1069 key = TryConvertKey(key, isolate()); | 1068 key = TryConvertKey(key, isolate()); |
| 1070 | 1069 |
| 1071 if (key->IsInternalizedString()) { | 1070 if (key->IsInternalizedString()) { |
| 1072 maybe_object = LoadIC::Load(object, Handle<String>::cast(key)); | 1071 maybe_object = LoadIC::Load(object, Handle<String>::cast(key)); |
| 1073 if (maybe_object->IsFailure()) return maybe_object; | 1072 if (maybe_object->IsFailure()) return maybe_object; |
| 1074 } else if (FLAG_use_ic && !object->IsAccessCheckNeeded()) { | 1073 } else if (FLAG_use_ic && !object->IsAccessCheckNeeded()) { |
| 1075 ASSERT(!object->IsJSGlobalProxy()); | 1074 ASSERT(!object->IsJSGlobalProxy()); |
| 1076 if (object->IsString() && key->IsNumber()) { | 1075 if (object->IsString() && key->IsNumber()) { |
| 1077 if (state() == UNINITIALIZED) stub = string_stub(); | 1076 if (state() == UNINITIALIZED) stub = string_stub(); |
| 1078 } else if (object->IsJSObject()) { | 1077 } else if (object->IsJSObject()) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 holder = Handle<JSObject>(lookup->holder(), lookup->isolate()); | 1133 holder = Handle<JSObject>(lookup->holder(), lookup->isolate()); |
| 1135 } | 1134 } |
| 1136 | 1135 |
| 1137 // While normally LookupTransition gets passed the receiver, in this case we | 1136 // While normally LookupTransition gets passed the receiver, in this case we |
| 1138 // pass the holder of the property that we overwrite. This keeps the holder in | 1137 // pass the holder of the property that we overwrite. This keeps the holder in |
| 1139 // the LookupResult intact so we can later use it to generate a prototype | 1138 // the LookupResult intact so we can later use it to generate a prototype |
| 1140 // chain check. This avoids a double lookup, but requires us to pass in the | 1139 // chain check. This avoids a double lookup, but requires us to pass in the |
| 1141 // receiver when trying to fetch extra information from the transition. | 1140 // receiver when trying to fetch extra information from the transition. |
| 1142 receiver->map()->LookupTransition(*holder, *name, lookup); | 1141 receiver->map()->LookupTransition(*holder, *name, lookup); |
| 1143 if (!lookup->IsTransition()) return false; | 1142 if (!lookup->IsTransition()) return false; |
| 1144 PropertyDetails target_details = lookup->GetTransitionDetails(); | 1143 PropertyDetails target_details = |
| 1144 lookup->GetTransitionDetails(receiver->map()); |
| 1145 if (target_details.IsReadOnly()) return false; | 1145 if (target_details.IsReadOnly()) return false; |
| 1146 | 1146 |
| 1147 // If the value that's being stored does not fit in the field that the | 1147 // If the value that's being stored does not fit in the field that the |
| 1148 // instance would transition to, create a new transition that fits the value. | 1148 // instance would transition to, create a new transition that fits the value. |
| 1149 // This has to be done before generating the IC, since that IC will embed the | 1149 // This has to be done before generating the IC, since that IC will embed the |
| 1150 // transition target. | 1150 // transition target. |
| 1151 // Ensure the instance and its map were migrated before trying to update the | 1151 // Ensure the instance and its map were migrated before trying to update the |
| 1152 // transition target. | 1152 // transition target. |
| 1153 ASSERT(!receiver->map()->is_deprecated()); | 1153 ASSERT(!receiver->map()->is_deprecated()); |
| 1154 if (!value->FitsRepresentation(target_details.representation())) { | 1154 if (!value->FitsRepresentation(target_details.representation())) { |
| 1155 Handle<Map> target(lookup->GetTransitionTarget()); | 1155 Handle<Map> target(lookup->GetTransitionMapFromMap(receiver->map())); |
| 1156 Map::GeneralizeRepresentation( | 1156 Map::GeneralizeRepresentation( |
| 1157 target, target->LastAdded(), | 1157 target, target->LastAdded(), |
| 1158 value->OptimalRepresentation(), FORCE_FIELD); | 1158 value->OptimalRepresentation(), FORCE_FIELD); |
| 1159 // Lookup the transition again since the transition tree may have changed | 1159 // Lookup the transition again since the transition tree may have changed |
| 1160 // entirely by the migration above. | 1160 // entirely by the migration above. |
| 1161 receiver->map()->LookupTransition(*holder, *name, lookup); | 1161 receiver->map()->LookupTransition(*holder, *name, lookup); |
| 1162 if (!lookup->IsTransition()) return false; | 1162 if (!lookup->IsTransition()) return false; |
| 1163 ic->MarkMonomorphicPrototypeFailure(); | 1163 ic->MarkMonomorphicPrototypeFailure(); |
| 1164 } | 1164 } |
| 1165 return true; | 1165 return true; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 | 1318 |
| 1319 Handle<JSObject> holder(lookup->holder()); | 1319 Handle<JSObject> holder(lookup->holder()); |
| 1320 // Handlers do not use strict mode. | 1320 // Handlers do not use strict mode. |
| 1321 StoreStubCompiler compiler(isolate(), kNonStrictMode, kind()); | 1321 StoreStubCompiler compiler(isolate(), kNonStrictMode, kind()); |
| 1322 switch (lookup->type()) { | 1322 switch (lookup->type()) { |
| 1323 case FIELD: | 1323 case FIELD: |
| 1324 return compiler.CompileStoreField(receiver, lookup, name); | 1324 return compiler.CompileStoreField(receiver, lookup, name); |
| 1325 case TRANSITION: { | 1325 case TRANSITION: { |
| 1326 // Explicitly pass in the receiver map since LookupForWrite may have | 1326 // Explicitly pass in the receiver map since LookupForWrite may have |
| 1327 // stored something else than the receiver in the holder. | 1327 // stored something else than the receiver in the holder. |
| 1328 Handle<Map> transition(lookup->GetTransitionTarget()); | 1328 Handle<Map> transition( |
| 1329 PropertyDetails details = transition->GetLastDescriptorDetails(); | 1329 lookup->GetTransitionTarget(receiver->map()), isolate()); |
| 1330 int descriptor = transition->LastAdded(); |
| 1331 |
| 1332 DescriptorArray* target_descriptors = transition->instance_descriptors(); |
| 1333 PropertyDetails details = target_descriptors->GetDetails(descriptor); |
| 1330 | 1334 |
| 1331 if (details.type() == CALLBACKS || details.attributes() != NONE) break; | 1335 if (details.type() == CALLBACKS || details.attributes() != NONE) break; |
| 1332 | 1336 |
| 1333 return compiler.CompileStoreTransition( | 1337 return compiler.CompileStoreTransition( |
| 1334 receiver, lookup, transition, name); | 1338 receiver, lookup, transition, name); |
| 1335 } | 1339 } |
| 1336 case NORMAL: | 1340 case NORMAL: |
| 1337 if (kind() == Code::KEYED_STORE_IC) break; | 1341 if (kind() == Code::KEYED_STORE_IC) break; |
| 1338 if (receiver->IsGlobalObject()) { | 1342 if (receiver->IsGlobalObject()) { |
| 1339 // The stub generated for the global object picks the value directly | 1343 // The stub generated for the global object picks the value directly |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1649 if (MigrateDeprecated(object)) { | 1653 if (MigrateDeprecated(object)) { |
| 1650 Handle<Object> result = Runtime::SetObjectProperty(isolate(), object, | 1654 Handle<Object> result = Runtime::SetObjectProperty(isolate(), object, |
| 1651 key, | 1655 key, |
| 1652 value, | 1656 value, |
| 1653 NONE, | 1657 NONE, |
| 1654 strict_mode()); | 1658 strict_mode()); |
| 1655 RETURN_IF_EMPTY_HANDLE(isolate(), result); | 1659 RETURN_IF_EMPTY_HANDLE(isolate(), result); |
| 1656 return *result; | 1660 return *result; |
| 1657 } | 1661 } |
| 1658 | 1662 |
| 1659 // Check for non-string values that can be converted into an | 1663 // Check for values that can be converted into an internalized string directly |
| 1660 // internalized string directly or is representable as a smi. | 1664 // or is representable as a smi. |
| 1661 key = TryConvertKey(key, isolate()); | 1665 key = TryConvertKey(key, isolate()); |
| 1662 | 1666 |
| 1663 MaybeObject* maybe_object = NULL; | 1667 MaybeObject* maybe_object = NULL; |
| 1664 Handle<Code> stub = generic_stub(); | 1668 Handle<Code> stub = generic_stub(); |
| 1665 | 1669 |
| 1666 if (key->IsInternalizedString()) { | 1670 if (key->IsInternalizedString()) { |
| 1667 maybe_object = StoreIC::Store(object, | 1671 maybe_object = StoreIC::Store(object, |
| 1668 Handle<String>::cast(key), | 1672 Handle<String>::cast(key), |
| 1669 value, | 1673 value, |
| 1670 JSReceiver::MAY_BE_STORE_FROM_KEYED); | 1674 JSReceiver::MAY_BE_STORE_FROM_KEYED); |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2360 case GENERIC: return Type::Any(zone); | 2364 case GENERIC: return Type::Any(zone); |
| 2361 } | 2365 } |
| 2362 UNREACHABLE(); | 2366 UNREACHABLE(); |
| 2363 return NULL; | 2367 return NULL; |
| 2364 } | 2368 } |
| 2365 | 2369 |
| 2366 | 2370 |
| 2367 MaybeObject* BinaryOpIC::Transition(Handle<AllocationSite> allocation_site, | 2371 MaybeObject* BinaryOpIC::Transition(Handle<AllocationSite> allocation_site, |
| 2368 Handle<Object> left, | 2372 Handle<Object> left, |
| 2369 Handle<Object> right) { | 2373 Handle<Object> right) { |
| 2370 State state(target()->extra_ic_state()); | 2374 State state(target()->extended_extra_ic_state()); |
| 2371 | 2375 |
| 2372 // Compute the actual result using the builtin for the binary operation. | 2376 // Compute the actual result using the builtin for the binary operation. |
| 2373 Object* builtin = isolate()->js_builtins_object()->javascript_builtin( | 2377 Object* builtin = isolate()->js_builtins_object()->javascript_builtin( |
| 2374 TokenToJSBuiltin(state.op())); | 2378 TokenToJSBuiltin(state.op())); |
| 2375 Handle<JSFunction> function = handle(JSFunction::cast(builtin), isolate()); | 2379 Handle<JSFunction> function = handle(JSFunction::cast(builtin), isolate()); |
| 2376 bool caught_exception; | 2380 bool caught_exception; |
| 2377 Handle<Object> result = Execution::Call( | 2381 Handle<Object> result = Execution::Call( |
| 2378 isolate(), function, left, 1, &right, &caught_exception); | 2382 isolate(), function, left, 1, &right, &caught_exception); |
| 2379 if (caught_exception) return Failure::Exception(); | 2383 if (caught_exception) return Failure::Exception(); |
| 2380 | 2384 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2676 RUNTIME_FUNCTION(Code*, CompareIC_Miss) { | 2680 RUNTIME_FUNCTION(Code*, CompareIC_Miss) { |
| 2677 HandleScope scope(isolate); | 2681 HandleScope scope(isolate); |
| 2678 ASSERT(args.length() == 3); | 2682 ASSERT(args.length() == 3); |
| 2679 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); | 2683 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); |
| 2680 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); | 2684 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); |
| 2681 } | 2685 } |
| 2682 | 2686 |
| 2683 | 2687 |
| 2684 void CompareNilIC::Clear(Address address, Code* target) { | 2688 void CompareNilIC::Clear(Address address, Code* target) { |
| 2685 if (IsCleared(target)) return; | 2689 if (IsCleared(target)) return; |
| 2686 ExtraICState state = target->extra_ic_state(); | 2690 ExtraICState state = target->extended_extra_ic_state(); |
| 2687 | 2691 |
| 2688 CompareNilICStub stub(state, HydrogenCodeStub::UNINITIALIZED); | 2692 CompareNilICStub stub(state, HydrogenCodeStub::UNINITIALIZED); |
| 2689 stub.ClearState(); | 2693 stub.ClearState(); |
| 2690 | 2694 |
| 2691 Code* code = NULL; | 2695 Code* code = NULL; |
| 2692 CHECK(stub.FindCodeInCache(&code, target->GetIsolate())); | 2696 CHECK(stub.FindCodeInCache(&code, target->GetIsolate())); |
| 2693 | 2697 |
| 2694 SetTargetAtAddress(address, code); | 2698 SetTargetAtAddress(address, code); |
| 2695 } | 2699 } |
| 2696 | 2700 |
| 2697 | 2701 |
| 2698 MaybeObject* CompareNilIC::DoCompareNilSlow(NilValue nil, | 2702 MaybeObject* CompareNilIC::DoCompareNilSlow(NilValue nil, |
| 2699 Handle<Object> object) { | 2703 Handle<Object> object) { |
| 2700 if (object->IsNull() || object->IsUndefined()) { | 2704 if (object->IsNull() || object->IsUndefined()) { |
| 2701 return Smi::FromInt(true); | 2705 return Smi::FromInt(true); |
| 2702 } | 2706 } |
| 2703 return Smi::FromInt(object->IsUndetectableObject()); | 2707 return Smi::FromInt(object->IsUndetectableObject()); |
| 2704 } | 2708 } |
| 2705 | 2709 |
| 2706 | 2710 |
| 2707 MaybeObject* CompareNilIC::CompareNil(Handle<Object> object) { | 2711 MaybeObject* CompareNilIC::CompareNil(Handle<Object> object) { |
| 2708 ExtraICState extra_ic_state = target()->extra_ic_state(); | 2712 ExtraICState extra_ic_state = target()->extended_extra_ic_state(); |
| 2709 | 2713 |
| 2710 CompareNilICStub stub(extra_ic_state); | 2714 CompareNilICStub stub(extra_ic_state); |
| 2711 | 2715 |
| 2712 // Extract the current supported types from the patched IC and calculate what | 2716 // Extract the current supported types from the patched IC and calculate what |
| 2713 // types must be supported as a result of the miss. | 2717 // types must be supported as a result of the miss. |
| 2714 bool already_monomorphic = stub.IsMonomorphic(); | 2718 bool already_monomorphic = stub.IsMonomorphic(); |
| 2715 | 2719 |
| 2716 stub.UpdateStatus(object); | 2720 stub.UpdateStatus(object); |
| 2717 | 2721 |
| 2718 NilValue nil = stub.GetNilValue(); | 2722 NilValue nil = stub.GetNilValue(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2782 return Builtins::SHR; | 2786 return Builtins::SHR; |
| 2783 break; | 2787 break; |
| 2784 case Token::SHL: | 2788 case Token::SHL: |
| 2785 return Builtins::SHL; | 2789 return Builtins::SHL; |
| 2786 break; | 2790 break; |
| 2787 } | 2791 } |
| 2788 } | 2792 } |
| 2789 | 2793 |
| 2790 | 2794 |
| 2791 MaybeObject* ToBooleanIC::ToBoolean(Handle<Object> object) { | 2795 MaybeObject* ToBooleanIC::ToBoolean(Handle<Object> object) { |
| 2792 ToBooleanStub stub(target()->extra_ic_state()); | 2796 ToBooleanStub stub(target()->extended_extra_ic_state()); |
| 2793 bool to_boolean_value = stub.UpdateStatus(object); | 2797 bool to_boolean_value = stub.UpdateStatus(object); |
| 2794 Handle<Code> code = stub.GetCode(isolate()); | 2798 Handle<Code> code = stub.GetCode(isolate()); |
| 2795 set_target(*code); | 2799 set_target(*code); |
| 2796 return Smi::FromInt(to_boolean_value ? 1 : 0); | 2800 return Smi::FromInt(to_boolean_value ? 1 : 0); |
| 2797 } | 2801 } |
| 2798 | 2802 |
| 2799 | 2803 |
| 2800 RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss) { | 2804 RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss) { |
| 2801 ASSERT(args.length() == 1); | 2805 ASSERT(args.length() == 1); |
| 2802 HandleScope scope(isolate); | 2806 HandleScope scope(isolate); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2813 #undef ADDR | 2817 #undef ADDR |
| 2814 }; | 2818 }; |
| 2815 | 2819 |
| 2816 | 2820 |
| 2817 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2821 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 2818 return IC_utilities[id]; | 2822 return IC_utilities[id]; |
| 2819 } | 2823 } |
| 2820 | 2824 |
| 2821 | 2825 |
| 2822 } } // namespace v8::internal | 2826 } } // namespace v8::internal |
| OLD | NEW |