OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 4215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4226 } | 4226 } |
4227 | 4227 |
4228 | 4228 |
4229 static bool LookupSetter(Handle<Map> map, | 4229 static bool LookupSetter(Handle<Map> map, |
4230 Handle<String> name, | 4230 Handle<String> name, |
4231 Handle<JSFunction>* setter, | 4231 Handle<JSFunction>* setter, |
4232 Handle<JSObject>* holder) { | 4232 Handle<JSObject>* holder) { |
4233 Handle<AccessorPair> accessors; | 4233 Handle<AccessorPair> accessors; |
4234 if (LookupAccessorPair(map, name, &accessors, holder) && | 4234 if (LookupAccessorPair(map, name, &accessors, holder) && |
4235 accessors->setter()->IsJSFunction()) { | 4235 accessors->setter()->IsJSFunction()) { |
4236 *setter = Handle<JSFunction>(JSFunction::cast(accessors->setter())); | 4236 Handle<JSFunction> func(JSFunction::cast(accessors->setter())); |
4237 CallOptimization call_optimization(func); | |
Michael Starzinger
2013/10/23 08:40:21
As discussed offline: Can we leave a TODO here tha
| |
4238 if (call_optimization.is_simple_api_call()) return false; | |
4239 *setter = func; | |
4237 return true; | 4240 return true; |
4238 } | 4241 } |
4239 return false; | 4242 return false; |
4240 } | 4243 } |
4241 | 4244 |
4242 | 4245 |
4243 // Determines whether the given array or object literal boilerplate satisfies | 4246 // Determines whether the given array or object literal boilerplate satisfies |
4244 // all limits to be considered for fast deep-copying and computes the total | 4247 // all limits to be considered for fast deep-copying and computes the total |
4245 // size of all objects that are part of the graph. | 4248 // size of all objects that are part of the graph. |
4246 static bool IsFastLiteral(Handle<JSObject> boilerplate, | 4249 static bool IsFastLiteral(Handle<JSObject> boilerplate, |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4739 | 4742 |
4740 | 4743 |
4741 bool HOptimizedGraphBuilder::PropertyAccessInfo::LoadResult(Handle<Map> map) { | 4744 bool HOptimizedGraphBuilder::PropertyAccessInfo::LoadResult(Handle<Map> map) { |
4742 if (lookup_.IsField()) { | 4745 if (lookup_.IsField()) { |
4743 access_ = HObjectAccess::ForField(map, &lookup_, name_); | 4746 access_ = HObjectAccess::ForField(map, &lookup_, name_); |
4744 } else if (lookup_.IsPropertyCallbacks()) { | 4747 } else if (lookup_.IsPropertyCallbacks()) { |
4745 Handle<Object> callback(lookup_.GetValueFromMap(*map), isolate()); | 4748 Handle<Object> callback(lookup_.GetValueFromMap(*map), isolate()); |
4746 if (!callback->IsAccessorPair()) return false; | 4749 if (!callback->IsAccessorPair()) return false; |
4747 Object* getter = Handle<AccessorPair>::cast(callback)->getter(); | 4750 Object* getter = Handle<AccessorPair>::cast(callback)->getter(); |
4748 if (!getter->IsJSFunction()) return false; | 4751 if (!getter->IsJSFunction()) return false; |
4749 accessor_ = handle(JSFunction::cast(getter)); | 4752 Handle<JSFunction> accessor = handle(JSFunction::cast(getter)); |
4753 CallOptimization call_optimization(accessor); | |
Michael Starzinger
2013/10/23 08:40:21
Likewise.
| |
4754 if (call_optimization.is_simple_api_call()) return false; | |
4755 accessor_ = accessor; | |
4750 } else if (lookup_.IsConstant()) { | 4756 } else if (lookup_.IsConstant()) { |
4751 constant_ = handle(lookup_.GetConstantFromMap(*map), isolate()); | 4757 constant_ = handle(lookup_.GetConstantFromMap(*map), isolate()); |
4752 } | 4758 } |
4753 | 4759 |
4754 return true; | 4760 return true; |
4755 } | 4761 } |
4756 | 4762 |
4757 | 4763 |
4758 bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() { | 4764 bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() { |
4759 Handle<Map> map = map_; | 4765 Handle<Map> map = map_; |
(...skipping 5054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9814 if (ShouldProduceTraceOutput()) { | 9820 if (ShouldProduceTraceOutput()) { |
9815 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9821 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
9816 } | 9822 } |
9817 | 9823 |
9818 #ifdef DEBUG | 9824 #ifdef DEBUG |
9819 graph_->Verify(false); // No full verify. | 9825 graph_->Verify(false); // No full verify. |
9820 #endif | 9826 #endif |
9821 } | 9827 } |
9822 | 9828 |
9823 } } // namespace v8::internal | 9829 } } // namespace v8::internal |
OLD | NEW |