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

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: rebased on r11394 Created 8 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
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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 return true; 1306 return true;
1307 } 1307 }
1308 1308
1309 static inline bool IsValidNotBuiltinContext(Object* ctx) { 1309 static inline bool IsValidNotBuiltinContext(Object* ctx) {
1310 return ctx->IsContext() && 1310 return ctx->IsContext() &&
1311 !Context::cast(ctx)->global()->IsJSBuiltinsObject(); 1311 !Context::cast(ctx)->global()->IsJSBuiltinsObject();
1312 } 1312 }
1313 1313
1314 1314
1315 static void VisitSharedFunctionInfoGeneric(Map* map, HeapObject* object) { 1315 static void VisitSharedFunctionInfoGeneric(Map* map, HeapObject* object) {
1316 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); 1316 reinterpret_cast<SharedFunctionInfo*>(object)->BeforeVisitingPointers();
1317
1318 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap();
1319 1317
1320 FixedBodyVisitor<StaticMarkingVisitor, 1318 FixedBodyVisitor<StaticMarkingVisitor,
1321 SharedFunctionInfo::BodyDescriptor, 1319 SharedFunctionInfo::BodyDescriptor,
1322 void>::Visit(map, object); 1320 void>::Visit(map, object);
1323 } 1321 }
1324 1322
1325 1323
1326 static void UpdateRegExpCodeAgeAndFlush(Heap* heap, 1324 static void UpdateRegExpCodeAgeAndFlush(Heap* heap,
1327 JSRegExp* re, 1325 JSRegExp* re,
1328 bool is_ascii) { 1326 bool is_ascii) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 } 1404 }
1407 VisitSharedFunctionInfoAndFlushCodeGeneric(map, object, false); 1405 VisitSharedFunctionInfoAndFlushCodeGeneric(map, object, false);
1408 } 1406 }
1409 1407
1410 1408
1411 static void VisitSharedFunctionInfoAndFlushCodeGeneric( 1409 static void VisitSharedFunctionInfoAndFlushCodeGeneric(
1412 Map* map, HeapObject* object, bool known_flush_code_candidate) { 1410 Map* map, HeapObject* object, bool known_flush_code_candidate) {
1413 Heap* heap = map->GetHeap(); 1411 Heap* heap = map->GetHeap();
1414 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object); 1412 SharedFunctionInfo* shared = reinterpret_cast<SharedFunctionInfo*>(object);
1415 1413
1416 if (shared->IsInobjectSlackTrackingInProgress()) shared->DetachInitialMap(); 1414 shared->BeforeVisitingPointers();
1417 1415
1418 if (shared->ic_age() != heap->global_ic_age()) { 1416 if (shared->ic_age() != heap->global_ic_age()) {
1419 shared->ResetForNewContext(heap->global_ic_age()); 1417 shared->ResetForNewContext(heap->global_ic_age());
1420 } 1418 }
1421 1419
1422 if (!known_flush_code_candidate) { 1420 if (!known_flush_code_candidate) {
1423 known_flush_code_candidate = IsFlushable(heap, shared); 1421 known_flush_code_candidate = IsFlushable(heap, shared);
1424 if (known_flush_code_candidate) { 1422 if (known_flush_code_candidate) {
1425 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared); 1423 heap->mark_compact_collector()->code_flusher()->AddCandidate(shared);
1426 } 1424 }
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 static void VisitSharedFunctionInfoFields(Heap* heap, 1545 static void VisitSharedFunctionInfoFields(Heap* heap,
1548 HeapObject* object, 1546 HeapObject* object,
1549 bool flush_code_candidate) { 1547 bool flush_code_candidate) {
1550 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset)); 1548 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kNameOffset));
1551 1549
1552 if (!flush_code_candidate) { 1550 if (!flush_code_candidate) {
1553 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset)); 1551 VisitPointer(heap, SLOT_ADDR(object, SharedFunctionInfo::kCodeOffset));
1554 } 1552 }
1555 1553
1556 VisitPointers(heap, 1554 VisitPointers(heap,
1557 SLOT_ADDR(object, SharedFunctionInfo::kScopeInfoOffset), 1555 SLOT_ADDR(object, SharedFunctionInfo::kOptimizedCodeMapOffset),
1558 SLOT_ADDR(object, SharedFunctionInfo::kSize)); 1556 SLOT_ADDR(object, SharedFunctionInfo::kSize));
1559 } 1557 }
1560 1558
1561 #undef SLOT_ADDR 1559 #undef SLOT_ADDR
1562 1560
1563 typedef void (*Callback)(Map* map, HeapObject* object); 1561 typedef void (*Callback)(Map* map, HeapObject* object);
1564 1562
1565 static VisitorDispatchTable<Callback> table_; 1563 static VisitorDispatchTable<Callback> table_;
1566 }; 1564 };
1567 1565
1568 1566
(...skipping 2572 matching lines...) Expand 10 before | Expand all | Expand 10 after
4141 while (buffer != NULL) { 4139 while (buffer != NULL) {
4142 SlotsBuffer* next_buffer = buffer->next(); 4140 SlotsBuffer* next_buffer = buffer->next();
4143 DeallocateBuffer(buffer); 4141 DeallocateBuffer(buffer);
4144 buffer = next_buffer; 4142 buffer = next_buffer;
4145 } 4143 }
4146 *buffer_address = NULL; 4144 *buffer_address = NULL;
4147 } 4145 }
4148 4146
4149 4147
4150 } } // namespace v8::internal 4148 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698