LGTM with a formatting suggestion.

Please have a close eye on performance; if there's other code somewhere that
needs to be updated to reflect these changes then that could cause tanking in
some corner cases.


https://chromiumcodereview.appspot.com/23442016/diff/9001/src/ic.cc
File src/ic.cc (right):

https://chromiumcodereview.appspot.com/23442016/diff/9001/src/ic.cc#newcode1713
src/ic.cc:1713: if (!can_store &&
nit: I'm finding this heterogeneous if/else cascade a little hard to
read, and I think I'd prefer the following alternative formatting:

  bool can_store = LookupForWrite(receiver, name, value, &lookup,
&state);
  if (!can_store &&
      strict_mode == kStrictMode &&
      !(lookup.IsProperty() && lookup.IsReadOnly()) &&
      IsUndeclaredGlobal(object)) {
    // Strict mode doesn't allow setting non-existent global property.
    return ReferenceError("not_defined", name);
  }
  if (FLAG_use_ic) {
    if (state == UNINITIALIZED) {
      Handle<Code> stub = (strict_mode == kStrictMode)
          ? pre_monomorphic_stub_strict()
          : pre_monomorphic_stub();
      set_target(*stub);
      TRACE_IC("StoreIC", name, state, *stub);
    } else if (can_store) {
      UpdateCaches(&lookup, state, strict_mode, receiver, name, value);
    } else if (!name->IsCacheable(isolate()) ||
               lookup.IsNormal() ||
               (lookup.IsField() && lookup.CanHoldValue(value))) {
      Handle<Code> stub = (strict_mode == kStrictMode) ?
generic_stub_strict()
                                                       : generic_stub();
      set_target(*stub);
    }
  }

I leave the decision up to you, though.

https://chromiumcodereview.appspot.com/23442016/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to