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

Side by Side Diff: src/objects.cc

Issue 25049003: Tag normal as handlers, and make code handler-specific. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplify code 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 | « src/objects.h ('k') | 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 10279 matching lines...) Expand 10 before | Expand all | Expand 10 after
10290 if (object->IsMap()) maps->Add(Handle<Map>(Map::cast(object))); 10290 if (object->IsMap()) maps->Add(Handle<Map>(Map::cast(object)));
10291 } 10291 }
10292 } 10292 }
10293 10293
10294 10294
10295 void Code::ReplaceFirstMap(Map* replace_with) { 10295 void Code::ReplaceFirstMap(Map* replace_with) {
10296 ReplaceNthObject(1, GetHeap()->meta_map(), replace_with); 10296 ReplaceNthObject(1, GetHeap()->meta_map(), replace_with);
10297 } 10297 }
10298 10298
10299 10299
10300 Code* Code::FindFirstCode() { 10300 Code* Code::FindFirstHandler() {
10301 ASSERT(is_inline_cache_stub()); 10301 ASSERT(is_inline_cache_stub());
10302 DisallowHeapAllocation no_allocation; 10302 DisallowHeapAllocation no_allocation;
10303 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET); 10303 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET);
10304 for (RelocIterator it(this, mask); !it.done(); it.next()) { 10304 for (RelocIterator it(this, mask); !it.done(); it.next()) {
10305 RelocInfo* info = it.rinfo(); 10305 RelocInfo* info = it.rinfo();
10306 return Code::GetCodeFromTargetAddress(info->target_address()); 10306 Code* code = Code::GetCodeFromTargetAddress(info->target_address());
10307 if (code->kind() == Code::HANDLER) return code;
10307 } 10308 }
10308 return NULL; 10309 return NULL;
10309 } 10310 }
10310 10311
10311 10312
10312 void Code::FindAllCode(CodeHandleList* code_list, int length) { 10313 bool Code::FindHandlers(CodeHandleList* code_list, int length) {
10313 ASSERT(is_inline_cache_stub()); 10314 ASSERT(is_inline_cache_stub());
10314 DisallowHeapAllocation no_allocation; 10315 DisallowHeapAllocation no_allocation;
10315 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET); 10316 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET);
10316 int i = 0; 10317 int i = 0;
10317 for (RelocIterator it(this, mask); !it.done(); it.next()) { 10318 for (RelocIterator it(this, mask); !it.done(); it.next()) {
10318 if (i++ == length) return; 10319 if (i == length) return true;
10319 RelocInfo* info = it.rinfo(); 10320 RelocInfo* info = it.rinfo();
10320 Code* code = Code::GetCodeFromTargetAddress(info->target_address()); 10321 Code* code = Code::GetCodeFromTargetAddress(info->target_address());
10321 ASSERT(code->kind() == Code::HANDLER); 10322 // IC stubs with handlers never contain non-handler code objects before
10323 // handler targets.
10324 if (code->kind() != Code::HANDLER) break;
10322 code_list->Add(Handle<Code>(code)); 10325 code_list->Add(Handle<Code>(code));
10326 i++;
10323 } 10327 }
10324 UNREACHABLE(); 10328 return i == length;
10325 } 10329 }
10326 10330
10327 10331
10328 Name* Code::FindFirstName() { 10332 Name* Code::FindFirstName() {
10329 ASSERT(is_inline_cache_stub()); 10333 ASSERT(is_inline_cache_stub());
10330 DisallowHeapAllocation no_allocation; 10334 DisallowHeapAllocation no_allocation;
10331 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); 10335 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
10332 for (RelocIterator it(this, mask); !it.done(); it.next()) { 10336 for (RelocIterator it(this, mask); !it.done(); it.next()) {
10333 RelocInfo* info = it.rinfo(); 10337 RelocInfo* info = it.rinfo();
10334 Object* object = info->target_object(); 10338 Object* object = info->target_object();
(...skipping 5784 matching lines...) Expand 10 before | Expand all | Expand 10 after
16119 #define ERROR_MESSAGES_TEXTS(C, T) T, 16123 #define ERROR_MESSAGES_TEXTS(C, T) T,
16120 static const char* error_messages_[] = { 16124 static const char* error_messages_[] = {
16121 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16125 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16122 }; 16126 };
16123 #undef ERROR_MESSAGES_TEXTS 16127 #undef ERROR_MESSAGES_TEXTS
16124 return error_messages_[reason]; 16128 return error_messages_[reason];
16125 } 16129 }
16126 16130
16127 16131
16128 } } // namespace v8::internal 16132 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698