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

Side by Side Diff: src/objects.cc

Issue 1272933004: [heap] Avoid inclusion of objects-visiting-inl.h header. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « src/heap/objects-visiting-inl.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <iomanip> 5 #include <iomanip>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
11 #include "src/allocation-site-scopes.h" 11 #include "src/allocation-site-scopes.h"
12 #include "src/api.h" 12 #include "src/api.h"
13 #include "src/arguments.h" 13 #include "src/arguments.h"
14 #include "src/base/bits.h" 14 #include "src/base/bits.h"
15 #include "src/base/utils/random-number-generator.h" 15 #include "src/base/utils/random-number-generator.h"
16 #include "src/bootstrapper.h" 16 #include "src/bootstrapper.h"
17 #include "src/code-stubs.h" 17 #include "src/code-stubs.h"
18 #include "src/codegen.h" 18 #include "src/codegen.h"
19 #include "src/compilation-dependencies.h" 19 #include "src/compilation-dependencies.h"
20 #include "src/compiler.h" 20 #include "src/compiler.h"
21 #include "src/cpu-profiler.h" 21 #include "src/cpu-profiler.h"
22 #include "src/date.h" 22 #include "src/date.h"
23 #include "src/debug/debug.h" 23 #include "src/debug/debug.h"
24 #include "src/deoptimizer.h" 24 #include "src/deoptimizer.h"
25 #include "src/elements.h" 25 #include "src/elements.h"
26 #include "src/execution.h" 26 #include "src/execution.h"
27 #include "src/field-index-inl.h" 27 #include "src/field-index-inl.h"
28 #include "src/field-index.h" 28 #include "src/field-index.h"
29 #include "src/full-codegen/full-codegen.h" 29 #include "src/full-codegen/full-codegen.h"
30 #include "src/heap/objects-visiting-inl.h"
Hannes Payer (out of office) 2015/08/11 06:07:24 yey!
31 #include "src/hydrogen.h" 30 #include "src/hydrogen.h"
32 #include "src/ic/ic.h" 31 #include "src/ic/ic.h"
33 #include "src/interpreter/bytecodes.h" 32 #include "src/interpreter/bytecodes.h"
34 #include "src/log.h" 33 #include "src/log.h"
35 #include "src/lookup.h" 34 #include "src/lookup.h"
36 #include "src/macro-assembler.h" 35 #include "src/macro-assembler.h"
37 #include "src/messages.h" 36 #include "src/messages.h"
38 #include "src/objects-inl.h" 37 #include "src/objects-inl.h"
39 #include "src/prototype.h" 38 #include "src/prototype.h"
40 #include "src/safepoint-table.h" 39 #include "src/safepoint-table.h"
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 1468
1470 void HeapObject::Iterate(ObjectVisitor* v) { 1469 void HeapObject::Iterate(ObjectVisitor* v) {
1471 // Handle header 1470 // Handle header
1472 IteratePointer(v, kMapOffset); 1471 IteratePointer(v, kMapOffset);
1473 // Handle object body 1472 // Handle object body
1474 Map* m = map(); 1473 Map* m = map();
1475 IterateBody(m->instance_type(), SizeFromMap(m), v); 1474 IterateBody(m->instance_type(), SizeFromMap(m), v);
1476 } 1475 }
1477 1476
1478 1477
1479 void HeapObject::IterateBody(InstanceType type, int object_size,
1480 ObjectVisitor* v) {
1481 // Avoiding <Type>::cast(this) because it accesses the map pointer field.
1482 // During GC, the map pointer field is encoded.
1483 if (type < FIRST_NONSTRING_TYPE) {
1484 switch (type & kStringRepresentationMask) {
1485 case kSeqStringTag:
1486 break;
1487 case kConsStringTag:
1488 ConsString::BodyDescriptor::IterateBody(this, v);
1489 break;
1490 case kSlicedStringTag:
1491 SlicedString::BodyDescriptor::IterateBody(this, v);
1492 break;
1493 case kExternalStringTag:
1494 if ((type & kStringEncodingMask) == kOneByteStringTag) {
1495 reinterpret_cast<ExternalOneByteString*>(this)
1496 ->ExternalOneByteStringIterateBody(v);
1497 } else {
1498 reinterpret_cast<ExternalTwoByteString*>(this)->
1499 ExternalTwoByteStringIterateBody(v);
1500 }
1501 break;
1502 }
1503 return;
1504 }
1505
1506 switch (type) {
1507 case FIXED_ARRAY_TYPE:
1508 FixedArray::BodyDescriptor::IterateBody(this, object_size, v);
1509 break;
1510 case FIXED_DOUBLE_ARRAY_TYPE:
1511 break;
1512 case JS_OBJECT_TYPE:
1513 case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
1514 case JS_GENERATOR_OBJECT_TYPE:
1515 case JS_MODULE_TYPE:
1516 case JS_VALUE_TYPE:
1517 case JS_DATE_TYPE:
1518 case JS_ARRAY_TYPE:
1519 case JS_ARRAY_BUFFER_TYPE:
1520 case JS_TYPED_ARRAY_TYPE:
1521 case JS_DATA_VIEW_TYPE:
1522 case JS_SET_TYPE:
1523 case JS_MAP_TYPE:
1524 case JS_SET_ITERATOR_TYPE:
1525 case JS_MAP_ITERATOR_TYPE:
1526 case JS_WEAK_MAP_TYPE:
1527 case JS_WEAK_SET_TYPE:
1528 case JS_REGEXP_TYPE:
1529 case JS_GLOBAL_PROXY_TYPE:
1530 case JS_GLOBAL_OBJECT_TYPE:
1531 case JS_BUILTINS_OBJECT_TYPE:
1532 case JS_MESSAGE_OBJECT_TYPE:
1533 JSObject::BodyDescriptor::IterateBody(this, object_size, v);
1534 break;
1535 case JS_FUNCTION_TYPE:
1536 reinterpret_cast<JSFunction*>(this)
1537 ->JSFunctionIterateBody(object_size, v);
1538 break;
1539 case ODDBALL_TYPE:
1540 Oddball::BodyDescriptor::IterateBody(this, v);
1541 break;
1542 case JS_PROXY_TYPE:
1543 JSProxy::BodyDescriptor::IterateBody(this, v);
1544 break;
1545 case JS_FUNCTION_PROXY_TYPE:
1546 JSFunctionProxy::BodyDescriptor::IterateBody(this, v);
1547 break;
1548 case FOREIGN_TYPE:
1549 reinterpret_cast<Foreign*>(this)->ForeignIterateBody(v);
1550 break;
1551 case MAP_TYPE:
1552 Map::BodyDescriptor::IterateBody(this, v);
1553 break;
1554 case CODE_TYPE:
1555 reinterpret_cast<Code*>(this)->CodeIterateBody(v);
1556 break;
1557 case CELL_TYPE:
1558 Cell::BodyDescriptor::IterateBody(this, v);
1559 break;
1560 case PROPERTY_CELL_TYPE:
1561 PropertyCell::BodyDescriptor::IterateBody(this, v);
1562 break;
1563 case WEAK_CELL_TYPE:
1564 WeakCell::BodyDescriptor::IterateBody(this, v);
1565 break;
1566 case SYMBOL_TYPE:
1567 Symbol::BodyDescriptor::IterateBody(this, v);
1568 break;
1569
1570 case HEAP_NUMBER_TYPE:
1571 case MUTABLE_HEAP_NUMBER_TYPE:
1572 case FLOAT32X4_TYPE:
1573 case INT32X4_TYPE:
1574 case BOOL32X4_TYPE:
1575 case INT16X8_TYPE:
1576 case BOOL16X8_TYPE:
1577 case INT8X16_TYPE:
1578 case BOOL8X16_TYPE:
1579 case FILLER_TYPE:
1580 case BYTE_ARRAY_TYPE:
1581 case BYTECODE_ARRAY_TYPE:
1582 case FREE_SPACE_TYPE:
1583 break;
1584
1585 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
1586 case FIXED_##TYPE##_ARRAY_TYPE: \
1587 reinterpret_cast<FixedTypedArrayBase*>(this) \
1588 ->FixedTypedArrayBaseIterateBody(v); \
1589 break;
1590
1591
1592 TYPED_ARRAYS(TYPED_ARRAY_CASE)
1593 #undef TYPED_ARRAY_CASE
1594
1595 case SHARED_FUNCTION_INFO_TYPE: {
1596 SharedFunctionInfo::BodyDescriptor::IterateBody(this, v);
1597 break;
1598 }
1599
1600 #define MAKE_STRUCT_CASE(NAME, Name, name) \
1601 case NAME##_TYPE:
1602 STRUCT_LIST(MAKE_STRUCT_CASE)
1603 #undef MAKE_STRUCT_CASE
1604 if (type == ALLOCATION_SITE_TYPE) {
1605 AllocationSite::BodyDescriptor::IterateBody(this, v);
1606 } else {
1607 StructBodyDescriptor::IterateBody(this, object_size, v);
1608 }
1609 break;
1610 default:
1611 PrintF("Unknown type: %d\n", type);
1612 UNREACHABLE();
1613 }
1614 }
1615
1616
1617 bool HeapNumber::HeapNumberBooleanValue() { 1478 bool HeapNumber::HeapNumberBooleanValue() {
1618 return DoubleToBoolean(value()); 1479 return DoubleToBoolean(value());
1619 } 1480 }
1620 1481
1621 1482
1622 void HeapNumber::HeapNumberPrint(std::ostream& os) { // NOLINT 1483 void HeapNumber::HeapNumberPrint(std::ostream& os) { // NOLINT
1623 os << value(); 1484 os << value();
1624 } 1485 }
1625 1486
1626 1487
(...skipping 14252 matching lines...) Expand 10 before | Expand all | Expand 10 after
15879 if (cell->value() != *new_value) { 15740 if (cell->value() != *new_value) {
15880 cell->set_value(*new_value); 15741 cell->set_value(*new_value);
15881 Isolate* isolate = cell->GetIsolate(); 15742 Isolate* isolate = cell->GetIsolate();
15882 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15743 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15883 isolate, DependentCode::kPropertyCellChangedGroup); 15744 isolate, DependentCode::kPropertyCellChangedGroup);
15884 } 15745 }
15885 } 15746 }
15886 15747
15887 } // namespace internal 15748 } // namespace internal
15888 } // namespace v8 15749 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698