| Index: src/ic.cc
|
| diff --git a/src/ic.cc b/src/ic.cc
|
| index 14fc6a9bf45db768d57253d72d1d2d53c1a53fab..fb1273941822c95429714f0e2a59b06139daf644 100644
|
| --- a/src/ic.cc
|
| +++ b/src/ic.cc
|
| @@ -148,7 +148,9 @@ IC::IC(FrameDepth depth, Isolate* isolate)
|
| pc_address_ = StackFrame::ResolveReturnAddressLocation(pc_address);
|
| target_ = handle(raw_target(), isolate);
|
| state_ = target_->ic_state();
|
| - extra_ic_state_ = target_->extra_ic_state();
|
| + extra_ic_state_ = target_->needs_extended_extra_ic_state(target_->kind())
|
| + ? target_->extended_extra_ic_state()
|
| + : target_->extra_ic_state();
|
| }
|
|
|
|
|
| @@ -643,7 +645,7 @@ bool IC::UpdatePolymorphicIC(Handle<HeapType> type,
|
| }
|
|
|
| Handle<Code> ic = isolate()->stub_cache()->ComputePolymorphicIC(
|
| - kind(), &types, &handlers, number_of_valid_types, name, extra_ic_state());
|
| + &types, &handlers, number_of_valid_types, name, extra_ic_state());
|
| set_target(*ic);
|
| return true;
|
| }
|
| @@ -695,7 +697,7 @@ void IC::UpdateMonomorphicIC(Handle<HeapType> type,
|
| Handle<String> name) {
|
| if (!handler->is_handler()) return set_target(*handler);
|
| Handle<Code> ic = isolate()->stub_cache()->ComputeMonomorphicIC(
|
| - kind(), name, type, handler, extra_ic_state());
|
| + name, type, handler, extra_ic_state());
|
| set_target(*ic);
|
| }
|
|
|
| @@ -845,11 +847,8 @@ Handle<Code> IC::ComputeHandler(LookupResult* lookup,
|
| isolate(), *object, cache_holder));
|
|
|
| Handle<Code> code = isolate()->stub_cache()->FindHandler(
|
| - name, handle(stub_holder->map()), kind(), cache_holder,
|
| - lookup->holder()->HasFastProperties() ? Code::FAST : Code::NORMAL);
|
| - if (!code.is_null()) {
|
| - return code;
|
| - }
|
| + name, handle(stub_holder->map()), kind(), cache_holder);
|
| + if (!code.is_null()) return code;
|
|
|
| code = CompileHandler(lookup, object, name, value, cache_holder);
|
| ASSERT(code->is_handler());
|
| @@ -1064,8 +1063,8 @@ MaybeObject* KeyedLoadIC::Load(Handle<Object> object, Handle<Object> key) {
|
| MaybeObject* maybe_object = NULL;
|
| Handle<Code> stub = generic_stub();
|
|
|
| - // Check for non-string values that can be converted into an
|
| - // internalized string directly or is representable as a smi.
|
| + // Check for values that can be converted into an internalized string directly
|
| + // or is representable as a smi.
|
| key = TryConvertKey(key, isolate());
|
|
|
| if (key->IsInternalizedString()) {
|
| @@ -1141,7 +1140,8 @@ static bool LookupForWrite(Handle<JSObject> receiver,
|
| // receiver when trying to fetch extra information from the transition.
|
| receiver->map()->LookupTransition(*holder, *name, lookup);
|
| if (!lookup->IsTransition()) return false;
|
| - PropertyDetails target_details = lookup->GetTransitionDetails();
|
| + PropertyDetails target_details =
|
| + lookup->GetTransitionDetails(receiver->map());
|
| if (target_details.IsReadOnly()) return false;
|
|
|
| // If the value that's being stored does not fit in the field that the
|
| @@ -1152,7 +1152,7 @@ static bool LookupForWrite(Handle<JSObject> receiver,
|
| // transition target.
|
| ASSERT(!receiver->map()->is_deprecated());
|
| if (!value->FitsRepresentation(target_details.representation())) {
|
| - Handle<Map> target(lookup->GetTransitionTarget());
|
| + Handle<Map> target(lookup->GetTransitionMapFromMap(receiver->map()));
|
| Map::GeneralizeRepresentation(
|
| target, target->LastAdded(),
|
| value->OptimalRepresentation(), FORCE_FIELD);
|
| @@ -1325,8 +1325,12 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
|
| case TRANSITION: {
|
| // Explicitly pass in the receiver map since LookupForWrite may have
|
| // stored something else than the receiver in the holder.
|
| - Handle<Map> transition(lookup->GetTransitionTarget());
|
| - PropertyDetails details = transition->GetLastDescriptorDetails();
|
| + Handle<Map> transition(
|
| + lookup->GetTransitionTarget(receiver->map()), isolate());
|
| + int descriptor = transition->LastAdded();
|
| +
|
| + DescriptorArray* target_descriptors = transition->instance_descriptors();
|
| + PropertyDetails details = target_descriptors->GetDetails(descriptor);
|
|
|
| if (details.type() == CALLBACKS || details.attributes() != NONE) break;
|
|
|
| @@ -1656,8 +1660,8 @@ MaybeObject* KeyedStoreIC::Store(Handle<Object> object,
|
| return *result;
|
| }
|
|
|
| - // Check for non-string values that can be converted into an
|
| - // internalized string directly or is representable as a smi.
|
| + // Check for values that can be converted into an internalized string directly
|
| + // or is representable as a smi.
|
| key = TryConvertKey(key, isolate());
|
|
|
| MaybeObject* maybe_object = NULL;
|
| @@ -2367,7 +2371,7 @@ Type* BinaryOpIC::State::KindToType(Kind kind, Zone* zone) {
|
| MaybeObject* BinaryOpIC::Transition(Handle<AllocationSite> allocation_site,
|
| Handle<Object> left,
|
| Handle<Object> right) {
|
| - State state(target()->extra_ic_state());
|
| + State state(target()->extended_extra_ic_state());
|
|
|
| // Compute the actual result using the builtin for the binary operation.
|
| Object* builtin = isolate()->js_builtins_object()->javascript_builtin(
|
| @@ -2683,7 +2687,7 @@ RUNTIME_FUNCTION(Code*, CompareIC_Miss) {
|
|
|
| void CompareNilIC::Clear(Address address, Code* target) {
|
| if (IsCleared(target)) return;
|
| - ExtraICState state = target->extra_ic_state();
|
| + ExtraICState state = target->extended_extra_ic_state();
|
|
|
| CompareNilICStub stub(state, HydrogenCodeStub::UNINITIALIZED);
|
| stub.ClearState();
|
| @@ -2705,7 +2709,7 @@ MaybeObject* CompareNilIC::DoCompareNilSlow(NilValue nil,
|
|
|
|
|
| MaybeObject* CompareNilIC::CompareNil(Handle<Object> object) {
|
| - ExtraICState extra_ic_state = target()->extra_ic_state();
|
| + ExtraICState extra_ic_state = target()->extended_extra_ic_state();
|
|
|
| CompareNilICStub stub(extra_ic_state);
|
|
|
| @@ -2789,7 +2793,7 @@ Builtins::JavaScript BinaryOpIC::TokenToJSBuiltin(Token::Value op) {
|
|
|
|
|
| MaybeObject* ToBooleanIC::ToBoolean(Handle<Object> object) {
|
| - ToBooleanStub stub(target()->extra_ic_state());
|
| + ToBooleanStub stub(target()->extended_extra_ic_state());
|
| bool to_boolean_value = stub.UpdateStatus(object);
|
| Handle<Code> code = stub.GetCode(isolate());
|
| set_target(*code);
|
|
|