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

Side by Side Diff: src/ast.cc

Issue 9240006: Fix handling of named interceptors in optimized code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 11 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 | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 SharedFunctionInfo* info = target->shared(); 728 SharedFunctionInfo* info = target->shared();
729 // If the number of formal parameters of the target function does 729 // If the number of formal parameters of the target function does
730 // not match the number of arguments we're passing, we don't want to 730 // not match the number of arguments we're passing, we don't want to
731 // deal with it. Otherwise, we can call it directly. 731 // deal with it. Otherwise, we can call it directly.
732 return !target->NeedsArgumentsAdaption() || 732 return !target->NeedsArgumentsAdaption() ||
733 info->formal_parameter_count() == arity; 733 info->formal_parameter_count() == arity;
734 } 734 }
735 735
736 736
737 bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) { 737 bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) {
738 // If there is an interceptor, we can't compute the target for
739 // a direct call.
740 if (type->has_named_interceptor()) return false;
741
738 if (check_type_ == RECEIVER_MAP_CHECK) { 742 if (check_type_ == RECEIVER_MAP_CHECK) {
739 // For primitive checks the holder is set up to point to the 743 // For primitive checks the holder is set up to point to the
740 // corresponding prototype object, i.e. one step of the algorithm 744 // corresponding prototype object, i.e. one step of the algorithm
741 // below has been already performed. 745 // below has been already performed.
742 // For non-primitive checks we clear it to allow computing targets 746 // For non-primitive checks we clear it to allow computing targets
743 // for polymorphic calls. 747 // for polymorphic calls.
744 holder_ = Handle<JSObject>::null(); 748 holder_ = Handle<JSObject>::null();
745 } 749 }
746 while (true) { 750 while (true) {
747 LookupResult lookup(type->GetIsolate()); 751 LookupResult lookup(type->GetIsolate());
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 int pos) 1215 int pos)
1212 : label_(label), 1216 : label_(label),
1213 statements_(statements), 1217 statements_(statements),
1214 position_(pos), 1218 position_(pos),
1215 compare_type_(NONE), 1219 compare_type_(NONE),
1216 compare_id_(AstNode::GetNextId(isolate)), 1220 compare_id_(AstNode::GetNextId(isolate)),
1217 entry_id_(AstNode::GetNextId(isolate)) { 1221 entry_id_(AstNode::GetNextId(isolate)) {
1218 } 1222 }
1219 1223
1220 } } // namespace v8::internal 1224 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698