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

Side by Side Diff: src/mark-compact.cc

Issue 10103035: Share optimized code for closures. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: 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
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/objects.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 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 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 return true; 1289 return true;
1290 } 1290 }
1291 1291
1292 static inline bool IsValidNotBuiltinContext(Object* ctx) { 1292 static inline bool IsValidNotBuiltinContext(Object* ctx) {
1293 return ctx->IsContext() && 1293 return ctx->IsContext() &&
1294 !Context::cast(ctx)->global()->IsJSBuiltinsObject(); 1294 !Context::cast(ctx)->global()->IsJSBuiltinsObject();
1295 } 1295 }
1296 1296
1297 1297
1298 static void VisitSharedFunctionInfoGeneric(Map* map, HeapObject* object) { 1298 static void VisitSharedFunctionInfoGeneric(Map* map, HeapObject* object) {
1299 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); 1299 SharedFunctionInfo::cast(object)->BeforeVisitingPointers();
1300
1301 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap();
1302 1300
1303 FixedBodyVisitor<StaticMarkingVisitor, 1301 FixedBodyVisitor<StaticMarkingVisitor,
1304 SharedFunctionInfo::BodyDescriptor, 1302 SharedFunctionInfo::BodyDescriptor,
1305 void>::Visit(map, object); 1303 void>::Visit(map, object);
1306 } 1304 }
1307 1305
1308 1306
1309 static void UpdateRegExpCodeAgeAndFlush(Heap* heap, 1307 static void UpdateRegExpCodeAgeAndFlush(Heap* heap,
1310 JSRegExp* re, 1308 JSRegExp* re,
1311 bool is_ascii) { 1309 bool is_ascii) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 } 1393 }
1396 VisitSharedFunctionInfoAndFlushCodeGeneric(map, object, false); 1394 VisitSharedFunctionInfoAndFlushCodeGeneric(map, object, false);
1397 } 1395 }
1398 1396
1399 1397
1400 static void VisitSharedFunctionInfoAndFlushCodeGeneric( 1398 static void VisitSharedFunctionInfoAndFlushCodeGeneric(
1401 Map* map, HeapObject* object, bool known_flush_code_candidate) { 1399 Map* map, HeapObject* object, bool known_flush_code_candidate) {
1402 Heap* heap = map->GetHeap(); 1400 Heap* heap = map->GetHeap();
1403 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); 1401 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object);
1404 1402
1405 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap(); 1403 shared->BeforeVisitingPointers();
1406 1404
1407 if (!known_flush_code_candidate) { 1405 if (!known_flush_code_candidate) {
1408 known_flush_code_candidate = IsFlushable(heap, shared); 1406 known_flush_code_candidate = IsFlushable(heap, shared);
1409 if (known_flush_code_candidate) { 1407 if (known_flush_code_candidate) {
1410 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared); 1408 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared);
1411 } 1409 }
1412 } 1410 }
1413 1411
1414 VisitSharedFunctionInfoFields(heap, object, known_flush_code_candidate); 1412 VisitSharedFunctionInfoFields(heap, object, known_flush_code_candidate);
1415 } 1413 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 static void VisitSharedFunctionInfoFields(Heap* heap, 1530 static void VisitSharedFunctionInfoFields(Heap* heap,
1533 HeapObject* object, 1531 HeapObject* object,
1534 bool flush_code_candidate) { 1532 bool flush_code_candidate) {
1535 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset)); 1533 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset));
1536 1534
1537 if (!flush_code_candidate) { 1535 if (!flush_code_candidate) {
1538 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset)); 1536 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset));
1539 } 1537 }
1540 1538
1541 VisitPointers(heap, 1539 VisitPointers(heap,
1542 SLOT_ADDR(object, SharedFunctionInfo::kScopeInfoOffset), 1540 SLOT_ADDR(object, SharedFunctionInfo::kOptimizedCodeMapOffset),
1543 SLOT_ADDR(object, SharedFunctionInfo::kSize)); 1541 SLOT_ADDR(object, SharedFunctionInfo::kSize));
1544 } 1542 }
1545 1543
1546 #undef SLOT_ADDR 1544 #undef SLOT_ADDR
1547 1545
1548 typedef void (*Callback)(Map* map, HeapObject* object); 1546 typedef void (*Callback)(Map* map, HeapObject* object);
1549 1547
1550 static VisitorDispatchTable<Callback> table_; 1548 static VisitorDispatchTable<Callback> table_;
1551 }; 1549 };
1552 1550
1553 1551
(...skipping 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after
4123 while (buffer != NULL) { 4121 while (buffer != NULL) {
4124 SlotsBuffer* next_buffer = buffer->next(); 4122 SlotsBuffer* next_buffer = buffer->next();
4125 DeallocateBuffer(buffer); 4123 DeallocateBuffer(buffer);
4126 buffer = next_buffer; 4124 buffer = next_buffer;
4127 } 4125 }
4128 *buffer_address = NULL; 4126 *buffer_address = NULL;
4129 } 4127 }
4130 4128
4131 4129
4132 } } // namespace v8::internal 4130 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698