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

Side by Side Diff: src/objects.cc

Issue 236313014: Limit the lifetime of handles in Map::UpdateCodeCache. (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 7254 matching lines...) Expand 10 before | Expand all | Expand 10 after
7265 ? SIMPLE_TRANSITION 7265 ? SIMPLE_TRANSITION
7266 : FULL_TRANSITION; 7266 : FULL_TRANSITION;
7267 return CopyReplaceDescriptors(map, new_descriptors, flag, key, simple_flag); 7267 return CopyReplaceDescriptors(map, new_descriptors, flag, key, simple_flag);
7268 } 7268 }
7269 7269
7270 7270
7271 void Map::UpdateCodeCache(Handle<Map> map, 7271 void Map::UpdateCodeCache(Handle<Map> map,
7272 Handle<Name> name, 7272 Handle<Name> name,
7273 Handle<Code> code) { 7273 Handle<Code> code) {
7274 Isolate* isolate = map->GetIsolate(); 7274 Isolate* isolate = map->GetIsolate();
7275 HandleScope scope(isolate);
7275 // Allocate the code cache if not present. 7276 // Allocate the code cache if not present.
7276 if (map->code_cache()->IsFixedArray()) { 7277 if (map->code_cache()->IsFixedArray()) {
7277 Handle<Object> result = isolate->factory()->NewCodeCache(); 7278 Handle<Object> result = isolate->factory()->NewCodeCache();
7278 map->set_code_cache(*result); 7279 map->set_code_cache(*result);
7279 } 7280 }
7280 7281
7281 // Update the code cache. 7282 // Update the code cache.
7282 Handle<CodeCache> code_cache(CodeCache::cast(map->code_cache()), isolate); 7283 Handle<CodeCache> code_cache(CodeCache::cast(map->code_cache()), isolate);
7283 CodeCache::Update(code_cache, name, code); 7284 CodeCache::Update(code_cache, name, code);
7284 } 7285 }
(...skipping 9307 matching lines...) Expand 10 before | Expand all | Expand 10 after
16592 #define ERROR_MESSAGES_TEXTS(C, T) T, 16593 #define ERROR_MESSAGES_TEXTS(C, T) T,
16593 static const char* error_messages_[] = { 16594 static const char* error_messages_[] = {
16594 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16595 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16595 }; 16596 };
16596 #undef ERROR_MESSAGES_TEXTS 16597 #undef ERROR_MESSAGES_TEXTS
16597 return error_messages_[reason]; 16598 return error_messages_[reason];
16598 } 16599 }
16599 16600
16600 16601
16601 } } // namespace v8::internal 16602 } } // 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