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

Side by Side Diff: src/runtime.cc

Issue 10444055: Promoting elements transitions to their own field. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: full patch Created 8 years, 6 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 1229
1230 1230
1231 RUNTIME_FUNCTION(MaybeObject*, Runtime_DisableAccessChecks) { 1231 RUNTIME_FUNCTION(MaybeObject*, Runtime_DisableAccessChecks) {
1232 ASSERT(args.length() == 1); 1232 ASSERT(args.length() == 1);
1233 CONVERT_ARG_CHECKED(HeapObject, object, 0); 1233 CONVERT_ARG_CHECKED(HeapObject, object, 0);
1234 Map* old_map = object->map(); 1234 Map* old_map = object->map();
1235 bool needs_access_checks = old_map->is_access_check_needed(); 1235 bool needs_access_checks = old_map->is_access_check_needed();
1236 if (needs_access_checks) { 1236 if (needs_access_checks) {
1237 // Copy map so it won't interfere constructor's initial map. 1237 // Copy map so it won't interfere constructor's initial map.
1238 Object* new_map; 1238 Object* new_map;
1239 { MaybeObject* maybe_new_map = old_map->CopyDropTransitions(); 1239 { MaybeObject* maybe_new_map = old_map->CopyDropTransitions(false);
1240 if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map; 1240 if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
1241 } 1241 }
1242 1242
1243 Map::cast(new_map)->set_is_access_check_needed(false); 1243 Map::cast(new_map)->set_is_access_check_needed(false);
1244 object->set_map(Map::cast(new_map)); 1244 object->set_map(Map::cast(new_map));
1245 } 1245 }
1246 return isolate->heap()->ToBoolean(needs_access_checks); 1246 return isolate->heap()->ToBoolean(needs_access_checks);
1247 } 1247 }
1248 1248
1249 1249
1250 RUNTIME_FUNCTION(MaybeObject*, Runtime_EnableAccessChecks) { 1250 RUNTIME_FUNCTION(MaybeObject*, Runtime_EnableAccessChecks) {
1251 ASSERT(args.length() == 1); 1251 ASSERT(args.length() == 1);
1252 CONVERT_ARG_CHECKED(HeapObject, object, 0); 1252 CONVERT_ARG_CHECKED(HeapObject, object, 0);
1253 Map* old_map = object->map(); 1253 Map* old_map = object->map();
1254 if (!old_map->is_access_check_needed()) { 1254 if (!old_map->is_access_check_needed()) {
1255 // Copy map so it won't interfere constructor's initial map. 1255 // Copy map so it won't interfere constructor's initial map.
1256 Object* new_map; 1256 Object* new_map;
1257 { MaybeObject* maybe_new_map = old_map->CopyDropTransitions(); 1257 { MaybeObject* maybe_new_map = old_map->CopyDropTransitions(false);
1258 if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map; 1258 if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
1259 } 1259 }
1260 1260
1261 Map::cast(new_map)->set_is_access_check_needed(true); 1261 Map::cast(new_map)->set_is_access_check_needed(true);
1262 object->set_map(Map::cast(new_map)); 1262 object->set_map(Map::cast(new_map));
1263 } 1263 }
1264 return isolate->heap()->undefined_value(); 1264 return isolate->heap()->undefined_value();
1265 } 1265 }
1266 1266
1267 1267
(...skipping 8964 matching lines...) Expand 10 before | Expand all | Expand 10 after
10232 } 10232 }
10233 return maybe_value; 10233 return maybe_value;
10234 } 10234 }
10235 return value; 10235 return value;
10236 } else { 10236 } else {
10237 return heap->undefined_value(); 10237 return heap->undefined_value();
10238 } 10238 }
10239 } 10239 }
10240 case INTERCEPTOR: 10240 case INTERCEPTOR:
10241 case MAP_TRANSITION: 10241 case MAP_TRANSITION:
10242 case ELEMENTS_TRANSITION:
10243 case CONSTANT_TRANSITION: 10242 case CONSTANT_TRANSITION:
10244 case NULL_DESCRIPTOR: 10243 case NULL_DESCRIPTOR:
10245 return heap->undefined_value(); 10244 return heap->undefined_value();
10246 case HANDLER: 10245 case HANDLER:
10247 UNREACHABLE(); 10246 UNREACHABLE();
10248 return heap->undefined_value(); 10247 return heap->undefined_value();
10249 } 10248 }
10250 UNREACHABLE(); // keep the compiler happy 10249 UNREACHABLE(); // keep the compiler happy
10251 return heap->undefined_value(); 10250 return heap->undefined_value();
10252 } 10251 }
(...skipping 3292 matching lines...) Expand 10 before | Expand all | Expand 10 after
13545 // Handle last resort GC and make sure to allow future allocations 13544 // Handle last resort GC and make sure to allow future allocations
13546 // to grow the heap without causing GCs (if possible). 13545 // to grow the heap without causing GCs (if possible).
13547 isolate->counters()->gc_last_resort_from_js()->Increment(); 13546 isolate->counters()->gc_last_resort_from_js()->Increment();
13548 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13547 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13549 "Runtime::PerformGC"); 13548 "Runtime::PerformGC");
13550 } 13549 }
13551 } 13550 }
13552 13551
13553 13552
13554 } } // namespace v8::internal 13553 } } // namespace v8::internal
OLDNEW
« src/property.cc ('K') | « src/property-details.h ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698