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

Side by Side Diff: src/hydrogen.cc

Issue 219723002: always lookup api holder from receiver (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 5470 matching lines...) Expand 10 before | Expand all | Expand 10 after
5481 } else if (lookup_.IsPropertyCallbacks()) { 5481 } else if (lookup_.IsPropertyCallbacks()) {
5482 Handle<Object> callback(lookup_.GetValueFromMap(*map), isolate()); 5482 Handle<Object> callback(lookup_.GetValueFromMap(*map), isolate());
5483 if (!callback->IsAccessorPair()) return false; 5483 if (!callback->IsAccessorPair()) return false;
5484 Object* raw_accessor = IsLoad() 5484 Object* raw_accessor = IsLoad()
5485 ? Handle<AccessorPair>::cast(callback)->getter() 5485 ? Handle<AccessorPair>::cast(callback)->getter()
5486 : Handle<AccessorPair>::cast(callback)->setter(); 5486 : Handle<AccessorPair>::cast(callback)->setter();
5487 if (!raw_accessor->IsJSFunction()) return false; 5487 if (!raw_accessor->IsJSFunction()) return false;
5488 Handle<JSFunction> accessor = handle(JSFunction::cast(raw_accessor)); 5488 Handle<JSFunction> accessor = handle(JSFunction::cast(raw_accessor));
5489 if (accessor->shared()->IsApiFunction()) { 5489 if (accessor->shared()->IsApiFunction()) {
5490 CallOptimization call_optimization(accessor); 5490 CallOptimization call_optimization(accessor);
5491 if (!call_optimization.is_simple_api_call()) return false; 5491 if (call_optimization.is_simple_api_call()) {
5492 CallOptimization::HolderLookup holder_lookup; 5492 CallOptimization::HolderLookup holder_lookup;
5493 api_holder_ = call_optimization.LookupHolderOfExpectedType( 5493 Handle<Map> receiver_map = this->map();
5494 map, &holder_lookup); 5494 api_holder_ = call_optimization.LookupHolderOfExpectedType(
5495 switch (holder_lookup) { 5495 receiver_map, &holder_lookup);
5496 case CallOptimization::kHolderNotFound:
5497 return false;
5498 case CallOptimization::kHolderIsReceiver:
5499 case CallOptimization::kHolderFound:
5500 break;
5501 } 5496 }
5502 } 5497 }
5503 accessor_ = accessor; 5498 accessor_ = accessor;
5504 } else if (lookup_.IsConstant()) { 5499 } else if (lookup_.IsConstant()) {
5505 constant_ = handle(lookup_.GetConstantFromMap(*map), isolate()); 5500 constant_ = handle(lookup_.GetConstantFromMap(*map), isolate());
5506 } 5501 }
5507 5502
5508 return true; 5503 return true;
5509 } 5504 }
5510 5505
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
7064 // Precondition: call is monomorphic and we have found a target with the 7059 // Precondition: call is monomorphic and we have found a target with the
7065 // appropriate arity. 7060 // appropriate arity.
7066 Handle<JSFunction> caller = current_info()->closure(); 7061 Handle<JSFunction> caller = current_info()->closure();
7067 Handle<SharedFunctionInfo> target_shared(target->shared()); 7062 Handle<SharedFunctionInfo> target_shared(target->shared());
7068 7063
7069 // Always inline builtins marked for inlining. 7064 // Always inline builtins marked for inlining.
7070 if (target->IsBuiltin()) { 7065 if (target->IsBuiltin()) {
7071 return target_shared->inline_builtin() ? 0 : kNotInlinable; 7066 return target_shared->inline_builtin() ? 0 : kNotInlinable;
7072 } 7067 }
7073 7068
7069 if (target_shared->IsApiFunction()) {
7070 TraceInline(target, caller, "target is api function");
7071 return kNotInlinable;
7072 }
7073
7074 // Do a quick check on source code length to avoid parsing large 7074 // Do a quick check on source code length to avoid parsing large
7075 // inlining candidates. 7075 // inlining candidates.
7076 if (target_shared->SourceSize() > 7076 if (target_shared->SourceSize() >
7077 Min(FLAG_max_inlined_source_size, kUnlimitedMaxInlinedSourceSize)) { 7077 Min(FLAG_max_inlined_source_size, kUnlimitedMaxInlinedSourceSize)) {
7078 TraceInline(target, caller, "target text too big"); 7078 TraceInline(target, caller, "target text too big");
7079 return kNotInlinable; 7079 return kNotInlinable;
7080 } 7080 }
7081 7081
7082 // Target must be inlineable. 7082 // Target must be inlineable.
7083 if (!target_shared->IsInlineable()) { 7083 if (!target_shared->IsInlineable()) {
(...skipping 4416 matching lines...) Expand 10 before | Expand all | Expand 10 after
11500 if (ShouldProduceTraceOutput()) { 11500 if (ShouldProduceTraceOutput()) {
11501 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11501 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11502 } 11502 }
11503 11503
11504 #ifdef DEBUG 11504 #ifdef DEBUG
11505 graph_->Verify(false); // No full verify. 11505 graph_->Verify(false); // No full verify.
11506 #endif 11506 #endif
11507 } 11507 }
11508 11508
11509 } } // namespace v8::internal 11509 } } // 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