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

Side by Side Diff: src/ast.cc

Issue 9280007: Replaced LookupResult::IsProperty by LookupResult::IsFound where possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 2 fixes 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 | « src/arm/stub-cache-arm.cc ('k') | src/bootstrapper.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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 } 739 }
740 while (true) { 740 while (true) {
741 LookupResult lookup(type->GetIsolate()); 741 LookupResult lookup(type->GetIsolate());
742 type->LookupInDescriptors(NULL, *name, &lookup); 742 type->LookupInDescriptors(NULL, *name, &lookup);
743 // If the function wasn't found directly in the map, we start 743 // If the function wasn't found directly in the map, we start
744 // looking upwards through the prototype chain. 744 // looking upwards through the prototype chain.
745 if ((!lookup.IsFound() || IsTransitionType(lookup.type())) 745 if ((!lookup.IsFound() || IsTransitionType(lookup.type()))
746 && type->prototype()->IsJSObject()) { 746 && type->prototype()->IsJSObject()) {
747 holder_ = Handle<JSObject>(JSObject::cast(type->prototype())); 747 holder_ = Handle<JSObject>(JSObject::cast(type->prototype()));
748 type = Handle<Map>(holder()->map()); 748 type = Handle<Map>(holder()->map());
749 } else if (lookup.IsProperty() && lookup.type() == CONSTANT_FUNCTION) { 749 } else if (lookup.IsFound() && lookup.type() == CONSTANT_FUNCTION) {
750 target_ = Handle<JSFunction>(lookup.GetConstantFunctionFromMap(*type)); 750 target_ = Handle<JSFunction>(lookup.GetConstantFunctionFromMap(*type));
751 return true; 751 return true;
752 } else { 752 } else {
753 return false; 753 return false;
754 } 754 }
755 } 755 }
756 } 756 }
757 757
758 758
759 bool Call::ComputeGlobalTarget(Handle<GlobalObject> global, 759 bool Call::ComputeGlobalTarget(Handle<GlobalObject> global,
760 LookupResult* lookup) { 760 LookupResult* lookup) {
761 target_ = Handle<JSFunction>::null(); 761 target_ = Handle<JSFunction>::null();
762 cell_ = Handle<JSGlobalPropertyCell>::null(); 762 cell_ = Handle<JSGlobalPropertyCell>::null();
763 ASSERT(lookup->IsProperty() && 763 ASSERT(lookup->IsFound() &&
764 lookup->type() == NORMAL && 764 lookup->type() == NORMAL &&
765 lookup->holder() == *global); 765 lookup->holder() == *global);
766 cell_ = Handle<JSGlobalPropertyCell>(global->GetPropertyCell(lookup)); 766 cell_ = Handle<JSGlobalPropertyCell>(global->GetPropertyCell(lookup));
767 if (cell_->value()->IsJSFunction()) { 767 if (cell_->value()->IsJSFunction()) {
768 Handle<JSFunction> candidate(JSFunction::cast(cell_->value())); 768 Handle<JSFunction> candidate(JSFunction::cast(cell_->value()));
769 // If the function is in new space we assume it's more likely to 769 // If the function is in new space we assume it's more likely to
770 // change and thus prefer the general IC code. 770 // change and thus prefer the general IC code.
771 if (!HEAP->InNewSpace(*candidate)) { 771 if (!HEAP->InNewSpace(*candidate)) {
772 target_ = candidate; 772 target_ = candidate;
773 return true; 773 return true;
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 int pos) 1204 int pos)
1205 : label_(label), 1205 : label_(label),
1206 statements_(statements), 1206 statements_(statements),
1207 position_(pos), 1207 position_(pos),
1208 compare_type_(NONE), 1208 compare_type_(NONE),
1209 compare_id_(AstNode::GetNextId(isolate)), 1209 compare_id_(AstNode::GetNextId(isolate)),
1210 entry_id_(AstNode::GetNextId(isolate)) { 1210 entry_id_(AstNode::GetNextId(isolate)) {
1211 } 1211 }
1212 1212
1213 } } // namespace v8::internal 1213 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698