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

Side by Side Diff: src/objects.cc

Issue 170203003: Use ComputeHandlerFlags to find handlers, rather than manually encoding. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Move type handling into lookup Created 6 years, 10 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/ic.cc ('k') | src/stub-cache.h » ('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 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 7493 matching lines...) Expand 10 before | Expand all | Expand 10 after
7504 Object* new_cache; 7504 Object* new_cache;
7505 { MaybeObject* maybe_new_cache = cache->Put(name, code); 7505 { MaybeObject* maybe_new_cache = cache->Put(name, code);
7506 if (!maybe_new_cache->ToObject(&new_cache)) return maybe_new_cache; 7506 if (!maybe_new_cache->ToObject(&new_cache)) return maybe_new_cache;
7507 } 7507 }
7508 set_normal_type_cache(new_cache); 7508 set_normal_type_cache(new_cache);
7509 return this; 7509 return this;
7510 } 7510 }
7511 7511
7512 7512
7513 Object* CodeCache::Lookup(Name* name, Code::Flags flags) { 7513 Object* CodeCache::Lookup(Name* name, Code::Flags flags) {
7514 flags = Code::RemoveTypeFromFlags(flags); 7514 Object* result = LookupDefaultCache(name, Code::RemoveTypeFromFlags(flags));
7515 Object* result = LookupDefaultCache(name, flags); 7515 if (result->IsCode()) {
7516 if (result->IsCode()) return result; 7516 if (Code::cast(result)->flags() == flags) return result;
7517 return GetHeap()->undefined_value();
7518 }
7517 return LookupNormalTypeCache(name, flags); 7519 return LookupNormalTypeCache(name, flags);
7518 } 7520 }
7519 7521
7520 7522
7521 Object* CodeCache::LookupDefaultCache(Name* name, Code::Flags flags) { 7523 Object* CodeCache::LookupDefaultCache(Name* name, Code::Flags flags) {
7522 FixedArray* cache = default_cache(); 7524 FixedArray* cache = default_cache();
7523 int length = cache->length(); 7525 int length = cache->length();
7524 for (int i = 0; i < length; i += kCodeCacheEntrySize) { 7526 for (int i = 0; i < length; i += kCodeCacheEntrySize) {
7525 Object* key = cache->get(i + kCodeCacheEntryNameOffset); 7527 Object* key = cache->get(i + kCodeCacheEntryNameOffset);
7526 // Skip deleted elements. 7528 // Skip deleted elements.
(...skipping 8953 matching lines...) Expand 10 before | Expand all | Expand 10 after
16480 #define ERROR_MESSAGES_TEXTS(C, T) T, 16482 #define ERROR_MESSAGES_TEXTS(C, T) T,
16481 static const char* error_messages_[] = { 16483 static const char* error_messages_[] = {
16482 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16484 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16483 }; 16485 };
16484 #undef ERROR_MESSAGES_TEXTS 16486 #undef ERROR_MESSAGES_TEXTS
16485 return error_messages_[reason]; 16487 return error_messages_[reason];
16486 } 16488 }
16487 16489
16488 16490
16489 } } // namespace v8::internal 16491 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698