Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: src/hydrogen.cc

Issue 34773003: force accessor pair accesses backed by simple api calls to be generic accesses when crankshafted (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: todos Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
4238 // TODO(dcarney): temporary hack unless crankshaft can handle api calls.
4239 if (call_optimization.is_simple_api_call()) return false;
4240 *setter = func;
4237 return true; 4241 return true;
4238 } 4242 }
4239 return false; 4243 return false;
4240 } 4244 }
4241 4245
4242 4246
4243 // Determines whether the given array or object literal boilerplate satisfies 4247 // Determines whether the given array or object literal boilerplate satisfies
4244 // all limits to be considered for fast deep-copying and computes the total 4248 // all limits to be considered for fast deep-copying and computes the total
4245 // size of all objects that are part of the graph. 4249 // size of all objects that are part of the graph.
4246 static bool IsFastLiteral(Handle<JSObject> boilerplate, 4250 static bool IsFastLiteral(Handle<JSObject> boilerplate,
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
4739 4743
4740 4744
4741 bool HOptimizedGraphBuilder::PropertyAccessInfo::LoadResult(Handle<Map> map) { 4745 bool HOptimizedGraphBuilder::PropertyAccessInfo::LoadResult(Handle<Map> map) {
4742 if (lookup_.IsField()) { 4746 if (lookup_.IsField()) {
4743 access_ = HObjectAccess::ForField(map, &lookup_, name_); 4747 access_ = HObjectAccess::ForField(map, &lookup_, name_);
4744 } else if (lookup_.IsPropertyCallbacks()) { 4748 } else if (lookup_.IsPropertyCallbacks()) {
4745 Handle<Object> callback(lookup_.GetValueFromMap(*map), isolate()); 4749 Handle<Object> callback(lookup_.GetValueFromMap(*map), isolate());
4746 if (!callback->IsAccessorPair()) return false; 4750 if (!callback->IsAccessorPair()) return false;
4747 Object* getter = Handle<AccessorPair>::cast(callback)->getter(); 4751 Object* getter = Handle<AccessorPair>::cast(callback)->getter();
4748 if (!getter->IsJSFunction()) return false; 4752 if (!getter->IsJSFunction()) return false;
4749 accessor_ = handle(JSFunction::cast(getter)); 4753 Handle<JSFunction> accessor = handle(JSFunction::cast(getter));
4754 CallOptimization call_optimization(accessor);
4755 // TODO(dcarney): temporary hack unless crankshaft can handle api calls.
4756 if (call_optimization.is_simple_api_call()) return false;
4757 accessor_ = accessor;
4750 } else if (lookup_.IsConstant()) { 4758 } else if (lookup_.IsConstant()) {
4751 constant_ = handle(lookup_.GetConstantFromMap(*map), isolate()); 4759 constant_ = handle(lookup_.GetConstantFromMap(*map), isolate());
4752 } 4760 }
4753 4761
4754 return true; 4762 return true;
4755 } 4763 }
4756 4764
4757 4765
4758 bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() { 4766 bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() {
4759 Handle<Map> map = map_; 4767 Handle<Map> map = map_;
(...skipping 5054 matching lines...) Expand 10 before | Expand all | Expand 10 after
9814 if (ShouldProduceTraceOutput()) { 9822 if (ShouldProduceTraceOutput()) {
9815 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9823 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9816 } 9824 }
9817 9825
9818 #ifdef DEBUG 9826 #ifdef DEBUG
9819 graph_->Verify(false); // No full verify. 9827 graph_->Verify(false); // No full verify.
9820 #endif 9828 #endif
9821 } 9829 }
9822 9830
9823 } } // namespace v8::internal 9831 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698