| OLD | NEW |
| 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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 "Expected property cell in type_info_cell") \ | 1123 "Expected property cell in type_info_cell") \ |
| 1124 V(kExpectedPropertyCellInRegisterA2, \ | 1124 V(kExpectedPropertyCellInRegisterA2, \ |
| 1125 "Expected property cell in register a2") \ | 1125 "Expected property cell in register a2") \ |
| 1126 V(kExpectedPropertyCellInRegisterEbx, \ | 1126 V(kExpectedPropertyCellInRegisterEbx, \ |
| 1127 "Expected property cell in register ebx") \ | 1127 "Expected property cell in register ebx") \ |
| 1128 V(kExpectedPropertyCellInRegisterRbx, \ | 1128 V(kExpectedPropertyCellInRegisterRbx, \ |
| 1129 "Expected property cell in register rbx") \ | 1129 "Expected property cell in register rbx") \ |
| 1130 V(kExpectedSmiOrHeapNumber, "expected smi or HeapNumber") \ | 1130 V(kExpectedSmiOrHeapNumber, "expected smi or HeapNumber") \ |
| 1131 V(kExpectingAlignmentForCopyBytes, \ | 1131 V(kExpectingAlignmentForCopyBytes, \ |
| 1132 "Expecting alignment for CopyBytes") \ | 1132 "Expecting alignment for CopyBytes") \ |
| 1133 V(kExportDeclaration, "Export declaration") \ |
| 1133 V(kExternalStringExpectedButNotFound, \ | 1134 V(kExternalStringExpectedButNotFound, \ |
| 1134 "external string expected, but not found") \ | 1135 "external string expected, but not found") \ |
| 1135 V(kFailedBailedOutLastTime, "failed/bailed out last time") \ | 1136 V(kFailedBailedOutLastTime, "failed/bailed out last time") \ |
| 1136 V(kForInStatementIsNotFastCase, "ForInStatement is not fast case") \ | 1137 V(kForInStatementIsNotFastCase, "ForInStatement is not fast case") \ |
| 1137 V(kForInStatementOptimizationIsDisabled, \ | 1138 V(kForInStatementOptimizationIsDisabled, \ |
| 1138 "ForInStatement optimization is disabled") \ | 1139 "ForInStatement optimization is disabled") \ |
| 1139 V(kForInStatementWithNonLocalEachVariable, \ | 1140 V(kForInStatementWithNonLocalEachVariable, \ |
| 1140 "ForInStatement with non-local each variable") \ | 1141 "ForInStatement with non-local each variable") \ |
| 1141 V(kForOfStatement, "ForOfStatement") \ | 1142 V(kForOfStatement, "ForOfStatement") \ |
| 1142 V(kFrameIsExpectedToBeAligned, "frame is expected to be aligned") \ | 1143 V(kFrameIsExpectedToBeAligned, "frame is expected to be aligned") \ |
| 1143 V(kFunctionCallsEval, "function calls eval") \ | 1144 V(kFunctionCallsEval, "function calls eval") \ |
| 1144 V(kFunctionIsAGenerator, "function is a generator") \ | 1145 V(kFunctionIsAGenerator, "function is a generator") \ |
| 1145 V(kFunctionWithIllegalRedeclaration, "function with illegal redeclaration") \ | 1146 V(kFunctionWithIllegalRedeclaration, "function with illegal redeclaration") \ |
| 1146 V(kGeneratedCodeIsTooLarge, "Generated code is too large") \ | 1147 V(kGeneratedCodeIsTooLarge, "Generated code is too large") \ |
| 1147 V(kGeneratorFailedToResume, "Generator failed to resume") \ | 1148 V(kGeneratorFailedToResume, "Generator failed to resume") \ |
| 1148 V(kGenerator, "generator") \ | 1149 V(kGenerator, "generator") \ |
| 1149 V(kGlobalFunctionsMustHaveInitialMap, \ | 1150 V(kGlobalFunctionsMustHaveInitialMap, \ |
| 1150 "Global functions must have initial map") \ | 1151 "Global functions must have initial map") \ |
| 1151 V(kHeapNumberMapRegisterClobbered, "HeapNumberMap register clobbered") \ | 1152 V(kHeapNumberMapRegisterClobbered, "HeapNumberMap register clobbered") \ |
| 1153 V(kImportDeclaration, "Import declaration") \ |
| 1152 V(kImproperObjectOnPrototypeChainForStore, \ | 1154 V(kImproperObjectOnPrototypeChainForStore, \ |
| 1153 "improper object on prototype chain for store") \ | 1155 "improper object on prototype chain for store") \ |
| 1154 V(kIndexIsNegative, "Index is negative") \ | 1156 V(kIndexIsNegative, "Index is negative") \ |
| 1155 V(kIndexIsTooLarge, "Index is too large") \ | 1157 V(kIndexIsTooLarge, "Index is too large") \ |
| 1156 V(kInlinedRuntimeFunctionClassOf, "inlined runtime function: ClassOf") \ | 1158 V(kInlinedRuntimeFunctionClassOf, "inlined runtime function: ClassOf") \ |
| 1157 V(kInlinedRuntimeFunctionFastAsciiArrayJoin, \ | 1159 V(kInlinedRuntimeFunctionFastAsciiArrayJoin, \ |
| 1158 "inlined runtime function: FastAsciiArrayJoin") \ | 1160 "inlined runtime function: FastAsciiArrayJoin") \ |
| 1159 V(kInlinedRuntimeFunctionGeneratorNext, \ | 1161 V(kInlinedRuntimeFunctionGeneratorNext, \ |
| 1160 "inlined runtime function: GeneratorNext") \ | 1162 "inlined runtime function: GeneratorNext") \ |
| 1161 V(kInlinedRuntimeFunctionGeneratorThrow, \ | 1163 V(kInlinedRuntimeFunctionGeneratorThrow, \ |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 V(kLiveEditFrameDroppingIsNotSupportedOnA64, \ | 1204 V(kLiveEditFrameDroppingIsNotSupportedOnA64, \ |
| 1203 "LiveEdit frame dropping is not supported on a64") \ | 1205 "LiveEdit frame dropping is not supported on a64") \ |
| 1204 V(kLiveEditFrameDroppingIsNotSupportedOnArm, \ | 1206 V(kLiveEditFrameDroppingIsNotSupportedOnArm, \ |
| 1205 "LiveEdit frame dropping is not supported on arm") \ | 1207 "LiveEdit frame dropping is not supported on arm") \ |
| 1206 V(kLiveEditFrameDroppingIsNotSupportedOnMips, \ | 1208 V(kLiveEditFrameDroppingIsNotSupportedOnMips, \ |
| 1207 "LiveEdit frame dropping is not supported on mips") \ | 1209 "LiveEdit frame dropping is not supported on mips") \ |
| 1208 V(kLiveEdit, "LiveEdit") \ | 1210 V(kLiveEdit, "LiveEdit") \ |
| 1209 V(kLookupVariableInCountOperation, \ | 1211 V(kLookupVariableInCountOperation, \ |
| 1210 "lookup variable in count operation") \ | 1212 "lookup variable in count operation") \ |
| 1211 V(kMapIsNoLongerInEax, "Map is no longer in eax") \ | 1213 V(kMapIsNoLongerInEax, "Map is no longer in eax") \ |
| 1214 V(kModuleDeclaration, "Module declaration") \ |
| 1215 V(kModuleLiteral, "Module literal") \ |
| 1216 V(kModulePath, "Module path") \ |
| 1217 V(kModuleStatement, "Module statement") \ |
| 1218 V(kModuleVariable, "Module variable") \ |
| 1219 V(kModuleUrl, "Module url") \ |
| 1212 V(kNoCasesLeft, "no cases left") \ | 1220 V(kNoCasesLeft, "no cases left") \ |
| 1213 V(kNoEmptyArraysHereInEmitFastAsciiArrayJoin, \ | 1221 V(kNoEmptyArraysHereInEmitFastAsciiArrayJoin, \ |
| 1214 "No empty arrays here in EmitFastAsciiArrayJoin") \ | 1222 "No empty arrays here in EmitFastAsciiArrayJoin") \ |
| 1215 V(kNonInitializerAssignmentToConst, \ | 1223 V(kNonInitializerAssignmentToConst, \ |
| 1216 "non-initializer assignment to const") \ | 1224 "non-initializer assignment to const") \ |
| 1217 V(kNonSmiIndex, "Non-smi index") \ | 1225 V(kNonSmiIndex, "Non-smi index") \ |
| 1218 V(kNonSmiKeyInArrayLiteral, "Non-smi key in array literal") \ | 1226 V(kNonSmiKeyInArrayLiteral, "Non-smi key in array literal") \ |
| 1219 V(kNonSmiValue, "Non-smi value") \ | 1227 V(kNonSmiValue, "Non-smi value") \ |
| 1220 V(kNotEnoughVirtualRegistersForValues, \ | 1228 V(kNotEnoughVirtualRegistersForValues, \ |
| 1221 "not enough virtual registers for values") \ | 1229 "not enough virtual registers for values") \ |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1246 V(kReferenceToAVariableWhichRequiresDynamicLookup, \ | 1254 V(kReferenceToAVariableWhichRequiresDynamicLookup, \ |
| 1247 "reference to a variable which requires dynamic lookup") \ | 1255 "reference to a variable which requires dynamic lookup") \ |
| 1248 V(kReferenceToGlobalLexicalVariable, \ | 1256 V(kReferenceToGlobalLexicalVariable, \ |
| 1249 "reference to global lexical variable") \ | 1257 "reference to global lexical variable") \ |
| 1250 V(kReferenceToUninitializedVariable, "reference to uninitialized variable") \ | 1258 V(kReferenceToUninitializedVariable, "reference to uninitialized variable") \ |
| 1251 V(kRegisterDidNotMatchExpectedRoot, "Register did not match expected root") \ | 1259 V(kRegisterDidNotMatchExpectedRoot, "Register did not match expected root") \ |
| 1252 V(kRegisterWasClobbered, "register was clobbered") \ | 1260 V(kRegisterWasClobbered, "register was clobbered") \ |
| 1253 V(kReturnAddressNotFoundInFrame, "return address not found in frame") \ | 1261 V(kReturnAddressNotFoundInFrame, "return address not found in frame") \ |
| 1254 V(kRhsHasBeenClobbered, "rhs has been clobbered") \ | 1262 V(kRhsHasBeenClobbered, "rhs has been clobbered") \ |
| 1255 V(kScopedBlock, "ScopedBlock") \ | 1263 V(kScopedBlock, "ScopedBlock") \ |
| 1256 V(kSharedFunctionInfoLiteral, "SharedFunctionInfoLiteral") \ | 1264 V(kSharedFunctionInfoLiteral, "Shared function info literal") \ |
| 1257 V(kSmiAdditionOverflow, "Smi addition overflow") \ | 1265 V(kSmiAdditionOverflow, "Smi addition overflow") \ |
| 1258 V(kSmiSubtractionOverflow, "Smi subtraction overflow") \ | 1266 V(kSmiSubtractionOverflow, "Smi subtraction overflow") \ |
| 1259 V(kStackAccessBelowStackPointer, "stack access below stack pointer") \ | 1267 V(kStackAccessBelowStackPointer, "stack access below stack pointer") \ |
| 1260 V(kStackFrameTypesMustMatch, "stack frame types must match") \ | 1268 V(kStackFrameTypesMustMatch, "stack frame types must match") \ |
| 1261 V(kSwitchStatementMixedOrNonLiteralSwitchLabels, \ | 1269 V(kSwitchStatementMixedOrNonLiteralSwitchLabels, \ |
| 1262 "SwitchStatement: mixed or non-literal switch labels") \ | 1270 "SwitchStatement: mixed or non-literal switch labels") \ |
| 1263 V(kSwitchStatementTooManyClauses, "SwitchStatement: too many clauses") \ | 1271 V(kSwitchStatementTooManyClauses, "SwitchStatement: too many clauses") \ |
| 1264 V(kTheCurrentStackPointerIsBelowCsp, \ | 1272 V(kTheCurrentStackPointerIsBelowCsp, \ |
| 1265 "the current stack pointer is below csp") \ | 1273 "the current stack pointer is below csp") \ |
| 1266 V(kTheInstructionShouldBeALui, "The instruction should be a lui") \ | 1274 V(kTheInstructionShouldBeALui, "The instruction should be a lui") \ |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 V(kUnsupportedNonPrimitiveCompare, "Unsupported non-primitive compare") \ | 1349 V(kUnsupportedNonPrimitiveCompare, "Unsupported non-primitive compare") \ |
| 1342 V(kUnsupportedPhiUseOfArguments, "Unsupported phi use of arguments") \ | 1350 V(kUnsupportedPhiUseOfArguments, "Unsupported phi use of arguments") \ |
| 1343 V(kUnsupportedPhiUseOfConstVariable, \ | 1351 V(kUnsupportedPhiUseOfConstVariable, \ |
| 1344 "Unsupported phi use of const variable") \ | 1352 "Unsupported phi use of const variable") \ |
| 1345 V(kUnsupportedTaggedImmediate, "unsupported tagged immediate") \ | 1353 V(kUnsupportedTaggedImmediate, "unsupported tagged immediate") \ |
| 1346 V(kVariableResolvedToWithContext, "Variable resolved to with context") \ | 1354 V(kVariableResolvedToWithContext, "Variable resolved to with context") \ |
| 1347 V(kWeShouldNotHaveAnEmptyLexicalContext, \ | 1355 V(kWeShouldNotHaveAnEmptyLexicalContext, \ |
| 1348 "we should not have an empty lexical context") \ | 1356 "we should not have an empty lexical context") \ |
| 1349 V(kWithStatement, "WithStatement") \ | 1357 V(kWithStatement, "WithStatement") \ |
| 1350 V(kWrongAddressOrValuePassedToRecordWrite, \ | 1358 V(kWrongAddressOrValuePassedToRecordWrite, \ |
| 1351 "Wrong address or value passed to RecordWrite") | 1359 "Wrong address or value passed to RecordWrite") \ |
| 1360 V(kYield, "Yield") |
| 1352 | 1361 |
| 1353 | 1362 |
| 1354 #define ERROR_MESSAGES_CONSTANTS(C, T) C, | 1363 #define ERROR_MESSAGES_CONSTANTS(C, T) C, |
| 1355 enum BailoutReason { | 1364 enum BailoutReason { |
| 1356 ERROR_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) | 1365 ERROR_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) |
| 1357 kLastErrorMessage | 1366 kLastErrorMessage |
| 1358 }; | 1367 }; |
| 1359 #undef ERROR_MESSAGES_CONSTANTS | 1368 #undef ERROR_MESSAGES_CONSTANTS |
| 1360 | 1369 |
| 1361 | 1370 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 inline MaybeObject* AllocateNewStorageFor(Heap* heap, | 1463 inline MaybeObject* AllocateNewStorageFor(Heap* heap, |
| 1455 Representation representation, | 1464 Representation representation, |
| 1456 PretenureFlag tenure = NOT_TENURED); | 1465 PretenureFlag tenure = NOT_TENURED); |
| 1457 | 1466 |
| 1458 // Returns true if the object is of the correct type to be used as a | 1467 // Returns true if the object is of the correct type to be used as a |
| 1459 // implementation of a JSObject's elements. | 1468 // implementation of a JSObject's elements. |
| 1460 inline bool HasValidElements(); | 1469 inline bool HasValidElements(); |
| 1461 | 1470 |
| 1462 inline bool HasSpecificClassOf(String* name); | 1471 inline bool HasSpecificClassOf(String* name); |
| 1463 | 1472 |
| 1464 MUST_USE_RESULT MaybeObject* ToObject(); // ECMA-262 9.9. | 1473 MUST_USE_RESULT MaybeObject* ToObject(Isolate* isolate); // ECMA-262 9.9. |
| 1465 bool BooleanValue(); // ECMA-262 9.2. | 1474 bool BooleanValue(); // ECMA-262 9.2. |
| 1466 | 1475 |
| 1467 // Convert to a JSObject if needed. | 1476 // Convert to a JSObject if needed. |
| 1468 // native_context is used when creating wrapper object. | 1477 // native_context is used when creating wrapper object. |
| 1469 MUST_USE_RESULT MaybeObject* ToObject(Context* native_context); | 1478 MUST_USE_RESULT MaybeObject* ToObject(Context* native_context); |
| 1470 | 1479 |
| 1471 // Converts this to a Smi if possible. | 1480 // Converts this to a Smi if possible. |
| 1472 // Failure is returned otherwise. | 1481 // Failure is returned otherwise. |
| 1473 MUST_USE_RESULT inline MaybeObject* ToSmi(); | 1482 MUST_USE_RESULT inline MaybeObject* ToSmi(); |
| 1474 | 1483 |
| 1475 void Lookup(Name* name, LookupResult* result); | 1484 void Lookup(Name* name, LookupResult* result); |
| 1476 | 1485 |
| 1477 // Property access. | 1486 // Property access. |
| 1478 MUST_USE_RESULT inline MaybeObject* GetProperty(Name* key); | 1487 MUST_USE_RESULT inline MaybeObject* GetProperty(Name* key); |
| 1479 MUST_USE_RESULT inline MaybeObject* GetProperty( | 1488 MUST_USE_RESULT inline MaybeObject* GetProperty( |
| 1480 Name* key, | 1489 Name* key, |
| 1481 PropertyAttributes* attributes); | 1490 PropertyAttributes* attributes); |
| 1482 MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver( | 1491 MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver( |
| 1483 Object* receiver, | 1492 Object* receiver, |
| 1484 Name* key, | 1493 Name* key, |
| 1485 PropertyAttributes* attributes); | 1494 PropertyAttributes* attributes); |
| 1486 | 1495 |
| 1487 static Handle<Object> GetProperty(Handle<Object> object, Handle<Name> key); | 1496 static Handle<Object> GetProperty(Handle<Object> object, |
| 1497 Handle<Name> key); |
| 1488 static Handle<Object> GetProperty(Handle<Object> object, | 1498 static Handle<Object> GetProperty(Handle<Object> object, |
| 1489 Handle<Object> receiver, | 1499 Handle<Object> receiver, |
| 1490 LookupResult* result, | 1500 LookupResult* result, |
| 1491 Handle<Name> key, | 1501 Handle<Name> key, |
| 1492 PropertyAttributes* attributes); | 1502 PropertyAttributes* attributes); |
| 1493 | 1503 |
| 1494 MUST_USE_RESULT static MaybeObject* GetPropertyOrFail( | 1504 MUST_USE_RESULT static MaybeObject* GetPropertyOrFail( |
| 1495 Handle<Object> object, | 1505 Handle<Object> object, |
| 1496 Handle<Object> receiver, | 1506 Handle<Object> receiver, |
| 1497 LookupResult* result, | 1507 LookupResult* result, |
| 1498 Handle<Name> key, | 1508 Handle<Name> key, |
| 1499 PropertyAttributes* attributes); | 1509 PropertyAttributes* attributes); |
| 1500 | 1510 |
| 1501 MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver, | 1511 MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver, |
| 1502 LookupResult* result, | 1512 LookupResult* result, |
| 1503 Name* key, | 1513 Name* key, |
| 1504 PropertyAttributes* attributes); | 1514 PropertyAttributes* attributes); |
| 1505 | 1515 |
| 1506 MUST_USE_RESULT MaybeObject* GetPropertyWithDefinedGetter(Object* receiver, | 1516 MUST_USE_RESULT MaybeObject* GetPropertyWithDefinedGetter(Object* receiver, |
| 1507 JSReceiver* getter); | 1517 JSReceiver* getter); |
| 1508 | 1518 |
| 1509 static Handle<Object> GetElement(Handle<Object> object, uint32_t index); | 1519 static Handle<Object> GetElement(Isolate* isolate, |
| 1510 MUST_USE_RESULT inline MaybeObject* GetElement(uint32_t index); | 1520 Handle<Object> object, |
| 1521 uint32_t index); |
| 1522 MUST_USE_RESULT inline MaybeObject* GetElement(Isolate* isolate, |
| 1523 uint32_t index); |
| 1511 // For use when we know that no exception can be thrown. | 1524 // For use when we know that no exception can be thrown. |
| 1512 inline Object* GetElementNoExceptionThrown(uint32_t index); | 1525 inline Object* GetElementNoExceptionThrown(Isolate* isolate, uint32_t index); |
| 1513 MUST_USE_RESULT MaybeObject* GetElementWithReceiver(Object* receiver, | 1526 MUST_USE_RESULT MaybeObject* GetElementWithReceiver(Isolate* isolate, |
| 1527 Object* receiver, |
| 1514 uint32_t index); | 1528 uint32_t index); |
| 1515 | 1529 |
| 1516 // Return the object's prototype (might be Heap::null_value()). | 1530 // Return the object's prototype (might be Heap::null_value()). |
| 1517 Object* GetPrototype(Isolate* isolate); | 1531 Object* GetPrototype(Isolate* isolate); |
| 1518 | 1532 |
| 1519 // Returns the permanent hash code associated with this object depending on | 1533 // Returns the permanent hash code associated with this object depending on |
| 1520 // the actual object type. Might return a failure in case no hash was | 1534 // the actual object type. Might return a failure in case no hash was |
| 1521 // created yet or GC was caused by creation. | 1535 // created yet or GC was caused by creation. |
| 1522 MUST_USE_RESULT MaybeObject* GetHash(CreationFlag flag); | 1536 MUST_USE_RESULT MaybeObject* GetHash(CreationFlag flag); |
| 1523 | 1537 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1726 inline void set_map_no_write_barrier(Map* value); | 1740 inline void set_map_no_write_barrier(Map* value); |
| 1727 | 1741 |
| 1728 // During garbage collection, the map word of a heap object does not | 1742 // During garbage collection, the map word of a heap object does not |
| 1729 // necessarily contain a map pointer. | 1743 // necessarily contain a map pointer. |
| 1730 inline MapWord map_word(); | 1744 inline MapWord map_word(); |
| 1731 inline void set_map_word(MapWord map_word); | 1745 inline void set_map_word(MapWord map_word); |
| 1732 | 1746 |
| 1733 // The Heap the object was allocated in. Used also to access Isolate. | 1747 // The Heap the object was allocated in. Used also to access Isolate. |
| 1734 inline Heap* GetHeap(); | 1748 inline Heap* GetHeap(); |
| 1735 | 1749 |
| 1736 // Convenience method to get current isolate. This method can be | 1750 // Convenience method to get current isolate. |
| 1737 // accessed only when its result is the same as | |
| 1738 // Isolate::Current(), it ASSERTs this. See also comment for GetHeap. | |
| 1739 inline Isolate* GetIsolate(); | 1751 inline Isolate* GetIsolate(); |
| 1740 | 1752 |
| 1741 // Converts an address to a HeapObject pointer. | 1753 // Converts an address to a HeapObject pointer. |
| 1742 static inline HeapObject* FromAddress(Address address); | 1754 static inline HeapObject* FromAddress(Address address); |
| 1743 | 1755 |
| 1744 // Returns the address of this HeapObject. | 1756 // Returns the address of this HeapObject. |
| 1745 inline Address address(); | 1757 inline Address address(); |
| 1746 | 1758 |
| 1747 // Iterates over pointers contained in the object (including the Map) | 1759 // Iterates over pointers contained in the object (including the Map) |
| 1748 void Iterate(ObjectVisitor* v); | 1760 void Iterate(ObjectVisitor* v); |
| (...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3199 | 3211 |
| 3200 // Search the instance descriptors for given name. | 3212 // Search the instance descriptors for given name. |
| 3201 INLINE(int Search(Name* name, int number_of_own_descriptors)); | 3213 INLINE(int Search(Name* name, int number_of_own_descriptors)); |
| 3202 | 3214 |
| 3203 // As the above, but uses DescriptorLookupCache and updates it when | 3215 // As the above, but uses DescriptorLookupCache and updates it when |
| 3204 // necessary. | 3216 // necessary. |
| 3205 INLINE(int SearchWithCache(Name* name, Map* map)); | 3217 INLINE(int SearchWithCache(Name* name, Map* map)); |
| 3206 | 3218 |
| 3207 // Allocates a DescriptorArray, but returns the singleton | 3219 // Allocates a DescriptorArray, but returns the singleton |
| 3208 // empty descriptor array object if number_of_descriptors is 0. | 3220 // empty descriptor array object if number_of_descriptors is 0. |
| 3209 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_descriptors, | 3221 MUST_USE_RESULT static MaybeObject* Allocate(Isolate* isolate, |
| 3222 int number_of_descriptors, |
| 3210 int slack = 0); | 3223 int slack = 0); |
| 3211 | 3224 |
| 3212 // Casting. | 3225 // Casting. |
| 3213 static inline DescriptorArray* cast(Object* obj); | 3226 static inline DescriptorArray* cast(Object* obj); |
| 3214 | 3227 |
| 3215 // Constant for denoting key was not found. | 3228 // Constant for denoting key was not found. |
| 3216 static const int kNotFound = -1; | 3229 static const int kNotFound = -1; |
| 3217 | 3230 |
| 3218 static const int kDescriptorLengthIndex = 0; | 3231 static const int kDescriptorLengthIndex = 0; |
| 3219 static const int kEnumCacheIndex = 1; | 3232 static const int kEnumCacheIndex = 1; |
| (...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4825 // [relocation_info]: Code relocation information | 4838 // [relocation_info]: Code relocation information |
| 4826 DECL_ACCESSORS(relocation_info, ByteArray) | 4839 DECL_ACCESSORS(relocation_info, ByteArray) |
| 4827 void InvalidateRelocation(); | 4840 void InvalidateRelocation(); |
| 4828 | 4841 |
| 4829 // [handler_table]: Fixed array containing offsets of exception handlers. | 4842 // [handler_table]: Fixed array containing offsets of exception handlers. |
| 4830 DECL_ACCESSORS(handler_table, FixedArray) | 4843 DECL_ACCESSORS(handler_table, FixedArray) |
| 4831 | 4844 |
| 4832 // [deoptimization_data]: Array containing data for deopt. | 4845 // [deoptimization_data]: Array containing data for deopt. |
| 4833 DECL_ACCESSORS(deoptimization_data, FixedArray) | 4846 DECL_ACCESSORS(deoptimization_data, FixedArray) |
| 4834 | 4847 |
| 4835 // [type_feedback_info]: Struct containing type feedback information for | 4848 // [type_feedback_info]: This field stores various things, depending on the |
| 4836 // unoptimized code. Optimized code can temporarily store the head of | 4849 // kind of the code object. |
| 4837 // the list of code to be deoptimized during mark-compact GC. | 4850 // FUNCTION => type feedback information. |
| 4838 // STUBs can use this slot to store arbitrary information as a Smi. | 4851 // STUB => various things, e.g. a SMI |
| 4839 // Will contain either a TypeFeedbackInfo object, or JSFunction object, | 4852 // OPTIMIZED_FUNCTION => the next_code_link for optimized code list. |
| 4840 // or undefined, or a Smi. | |
| 4841 DECL_ACCESSORS(type_feedback_info, Object) | 4853 DECL_ACCESSORS(type_feedback_info, Object) |
| 4842 inline void InitializeTypeFeedbackInfoNoWriteBarrier(Object* value); | 4854 inline void InitializeTypeFeedbackInfoNoWriteBarrier(Object* value); |
| 4843 inline int stub_info(); | 4855 inline int stub_info(); |
| 4844 inline void set_stub_info(int info); | 4856 inline void set_stub_info(int info); |
| 4845 | 4857 |
| 4846 // Used during GC to code a list of code objects to deoptimize. | 4858 // [next_code_link]: Link for lists of optimized or deoptimized code. |
| 4847 inline Object* code_to_deoptimize_link(); | 4859 // Note that storage for this field is overlapped with typefeedback_info. |
| 4848 inline void set_code_to_deoptimize_link(Object* value); | 4860 DECL_ACCESSORS(next_code_link, Object) |
| 4849 inline Object** code_to_deoptimize_link_slot(); | |
| 4850 | 4861 |
| 4851 // [gc_metadata]: Field used to hold GC related metadata. The contents of this | 4862 // [gc_metadata]: Field used to hold GC related metadata. The contents of this |
| 4852 // field does not have to be traced during garbage collection since | 4863 // field does not have to be traced during garbage collection since |
| 4853 // it is only used by the garbage collector itself. | 4864 // it is only used by the garbage collector itself. |
| 4854 DECL_ACCESSORS(gc_metadata, Object) | 4865 DECL_ACCESSORS(gc_metadata, Object) |
| 4855 | 4866 |
| 4856 // [ic_age]: Inline caching age: the value of the Heap::global_ic_age | 4867 // [ic_age]: Inline caching age: the value of the Heap::global_ic_age |
| 4857 // at the moment when this object was created. | 4868 // at the moment when this object was created. |
| 4858 inline void set_ic_age(int count); | 4869 inline void set_ic_age(int count); |
| 4859 inline int ic_age(); | 4870 inline int ic_age(); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5119 | 5130 |
| 5120 template<typename StaticVisitor> | 5131 template<typename StaticVisitor> |
| 5121 inline void CodeIterateBody(Heap* heap); | 5132 inline void CodeIterateBody(Heap* heap); |
| 5122 | 5133 |
| 5123 DECLARE_PRINTER(Code) | 5134 DECLARE_PRINTER(Code) |
| 5124 DECLARE_VERIFIER(Code) | 5135 DECLARE_VERIFIER(Code) |
| 5125 | 5136 |
| 5126 void ClearInlineCaches(); | 5137 void ClearInlineCaches(); |
| 5127 void ClearTypeFeedbackCells(Heap* heap); | 5138 void ClearTypeFeedbackCells(Heap* heap); |
| 5128 | 5139 |
| 5140 BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); |
| 5141 |
| 5129 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, | 5142 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, |
| 5130 enum Age { | 5143 enum Age { |
| 5131 kNoAge = 0, | 5144 kNoAge = 0, |
| 5132 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) | 5145 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) |
| 5133 kAfterLastCodeAge, | 5146 kAfterLastCodeAge, |
| 5134 kLastCodeAge = kAfterLastCodeAge - 1, | 5147 kLastCodeAge = kAfterLastCodeAge - 1, |
| 5135 kCodeAgeCount = kAfterLastCodeAge - 1 | 5148 kCodeAgeCount = kAfterLastCodeAge - 1 |
| 5136 }; | 5149 }; |
| 5137 #undef DECLARE_CODE_AGE_ENUM | 5150 #undef DECLARE_CODE_AGE_ENUM |
| 5138 | 5151 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 5158 static const int kMaxLoopNestingMarker = 6; | 5171 static const int kMaxLoopNestingMarker = 6; |
| 5159 | 5172 |
| 5160 // Layout description. | 5173 // Layout description. |
| 5161 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 5174 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; |
| 5162 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; | 5175 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; |
| 5163 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; | 5176 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; |
| 5164 static const int kDeoptimizationDataOffset = | 5177 static const int kDeoptimizationDataOffset = |
| 5165 kHandlerTableOffset + kPointerSize; | 5178 kHandlerTableOffset + kPointerSize; |
| 5166 static const int kTypeFeedbackInfoOffset = | 5179 static const int kTypeFeedbackInfoOffset = |
| 5167 kDeoptimizationDataOffset + kPointerSize; | 5180 kDeoptimizationDataOffset + kPointerSize; |
| 5181 static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset; // Shared. |
| 5168 static const int kGCMetadataOffset = kTypeFeedbackInfoOffset + kPointerSize; | 5182 static const int kGCMetadataOffset = kTypeFeedbackInfoOffset + kPointerSize; |
| 5169 static const int kICAgeOffset = | 5183 static const int kICAgeOffset = |
| 5170 kGCMetadataOffset + kPointerSize; | 5184 kGCMetadataOffset + kPointerSize; |
| 5171 static const int kFlagsOffset = kICAgeOffset + kIntSize; | 5185 static const int kFlagsOffset = kICAgeOffset + kIntSize; |
| 5172 static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize; | 5186 static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize; |
| 5173 static const int kKindSpecificFlags2Offset = | 5187 static const int kKindSpecificFlags2Offset = |
| 5174 kKindSpecificFlags1Offset + kIntSize; | 5188 kKindSpecificFlags1Offset + kIntSize; |
| 5175 // Note: We might be able to squeeze this into the flags above. | 5189 // Note: We might be able to squeeze this into the flags above. |
| 5176 static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize; | 5190 static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize; |
| 5177 | 5191 |
| (...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6571 // deoptimization. | 6585 // deoptimization. |
| 6572 inline bool has_deoptimization_support(); | 6586 inline bool has_deoptimization_support(); |
| 6573 | 6587 |
| 6574 // Enable deoptimization support through recompiled code. | 6588 // Enable deoptimization support through recompiled code. |
| 6575 void EnableDeoptimizationSupport(Code* recompiled); | 6589 void EnableDeoptimizationSupport(Code* recompiled); |
| 6576 | 6590 |
| 6577 // Disable (further) attempted optimization of all functions sharing this | 6591 // Disable (further) attempted optimization of all functions sharing this |
| 6578 // shared function info. | 6592 // shared function info. |
| 6579 void DisableOptimization(BailoutReason reason); | 6593 void DisableOptimization(BailoutReason reason); |
| 6580 | 6594 |
| 6595 inline BailoutReason DisableOptimizationReason(); |
| 6596 |
| 6581 // Lookup the bailout ID and ASSERT that it exists in the non-optimized | 6597 // Lookup the bailout ID and ASSERT that it exists in the non-optimized |
| 6582 // code, returns whether it asserted (i.e., always true if assertions are | 6598 // code, returns whether it asserted (i.e., always true if assertions are |
| 6583 // disabled). | 6599 // disabled). |
| 6584 bool VerifyBailoutId(BailoutId id); | 6600 bool VerifyBailoutId(BailoutId id); |
| 6585 | 6601 |
| 6586 // [source code]: Source code for the function. | 6602 // [source code]: Source code for the function. |
| 6587 bool HasSourceCode(); | 6603 bool HasSourceCode(); |
| 6588 Handle<Object> GetSourceCode(); | 6604 Handle<Object> GetSourceCode(); |
| 6589 | 6605 |
| 6590 // Number of times the function was optimized. | 6606 // Number of times the function was optimized. |
| 6591 inline int opt_count(); | 6607 inline int opt_count(); |
| 6592 inline void set_opt_count(int opt_count); | 6608 inline void set_opt_count(int opt_count); |
| 6593 | 6609 |
| 6594 // Number of times the function was deoptimized. | 6610 // Number of times the function was deoptimized. |
| 6595 inline void set_deopt_count(int value); | 6611 inline void set_deopt_count(int value); |
| 6596 inline int deopt_count(); | 6612 inline int deopt_count(); |
| 6597 inline void increment_deopt_count(); | 6613 inline void increment_deopt_count(); |
| 6598 | 6614 |
| 6599 // Number of time we tried to re-enable optimization after it | 6615 // Number of time we tried to re-enable optimization after it |
| 6600 // was disabled due to high number of deoptimizations. | 6616 // was disabled due to high number of deoptimizations. |
| 6601 inline void set_opt_reenable_tries(int value); | 6617 inline void set_opt_reenable_tries(int value); |
| 6602 inline int opt_reenable_tries(); | 6618 inline int opt_reenable_tries(); |
| 6603 | 6619 |
| 6604 inline void TryReenableOptimization(); | 6620 inline void TryReenableOptimization(); |
| 6605 | 6621 |
| 6606 // Stores deopt_count, opt_reenable_tries and ic_age as bit-fields. | 6622 // Stores deopt_count, opt_reenable_tries and ic_age as bit-fields. |
| 6607 inline void set_counters(int value); | 6623 inline void set_counters(int value); |
| 6608 inline int counters(); | 6624 inline int counters(); |
| 6609 | 6625 |
| 6626 // Stores opt_count and bailout_reason as bit-fields. |
| 6627 inline void set_opt_count_and_bailout_reason(int value); |
| 6628 inline int opt_count_and_bailout_reason(); |
| 6629 |
| 6630 void set_bailout_reason(BailoutReason reason) { |
| 6631 set_opt_count_and_bailout_reason( |
| 6632 DisabledOptimizationReasonBits::update(opt_count_and_bailout_reason(), |
| 6633 reason)); |
| 6634 } |
| 6635 |
| 6636 void set_dont_optimize_reason(BailoutReason reason) { |
| 6637 set_bailout_reason(reason); |
| 6638 set_dont_optimize(reason != kNoReason); |
| 6639 } |
| 6640 |
| 6610 // Source size of this function. | 6641 // Source size of this function. |
| 6611 int SourceSize(); | 6642 int SourceSize(); |
| 6612 | 6643 |
| 6613 // Calculate the instance size. | 6644 // Calculate the instance size. |
| 6614 int CalculateInstanceSize(); | 6645 int CalculateInstanceSize(); |
| 6615 | 6646 |
| 6616 // Calculate the number of in-object properties. | 6647 // Calculate the number of in-object properties. |
| 6617 int CalculateInObjectProperties(); | 6648 int CalculateInObjectProperties(); |
| 6618 | 6649 |
| 6619 // Dispatched behavior. | 6650 // Dispatched behavior. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6666 static const int kNumLiteralsOffset = | 6697 static const int kNumLiteralsOffset = |
| 6667 kExpectedNofPropertiesOffset + kPointerSize; | 6698 kExpectedNofPropertiesOffset + kPointerSize; |
| 6668 static const int kStartPositionAndTypeOffset = | 6699 static const int kStartPositionAndTypeOffset = |
| 6669 kNumLiteralsOffset + kPointerSize; | 6700 kNumLiteralsOffset + kPointerSize; |
| 6670 static const int kEndPositionOffset = | 6701 static const int kEndPositionOffset = |
| 6671 kStartPositionAndTypeOffset + kPointerSize; | 6702 kStartPositionAndTypeOffset + kPointerSize; |
| 6672 static const int kFunctionTokenPositionOffset = | 6703 static const int kFunctionTokenPositionOffset = |
| 6673 kEndPositionOffset + kPointerSize; | 6704 kEndPositionOffset + kPointerSize; |
| 6674 static const int kCompilerHintsOffset = | 6705 static const int kCompilerHintsOffset = |
| 6675 kFunctionTokenPositionOffset + kPointerSize; | 6706 kFunctionTokenPositionOffset + kPointerSize; |
| 6676 static const int kOptCountOffset = kCompilerHintsOffset + kPointerSize; | 6707 static const int kOptCountAndBailoutReasonOffset = |
| 6677 static const int kCountersOffset = kOptCountOffset + kPointerSize; | 6708 kCompilerHintsOffset + kPointerSize; |
| 6709 static const int kCountersOffset = |
| 6710 kOptCountAndBailoutReasonOffset + kPointerSize; |
| 6678 | 6711 |
| 6679 // Total size. | 6712 // Total size. |
| 6680 static const int kSize = kCountersOffset + kPointerSize; | 6713 static const int kSize = kCountersOffset + kPointerSize; |
| 6681 #else | 6714 #else |
| 6682 // The only reason to use smi fields instead of int fields | 6715 // The only reason to use smi fields instead of int fields |
| 6683 // is to allow iteration without maps decoding during | 6716 // is to allow iteration without maps decoding during |
| 6684 // garbage collections. | 6717 // garbage collections. |
| 6685 // To avoid wasting space on 64-bit architectures we use | 6718 // To avoid wasting space on 64-bit architectures we use |
| 6686 // the following trick: we group integer fields into pairs | 6719 // the following trick: we group integer fields into pairs |
| 6687 // First integer in each pair is shifted left by 1. | 6720 // First integer in each pair is shifted left by 1. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 6701 static const int kEndPositionOffset = | 6734 static const int kEndPositionOffset = |
| 6702 kNumLiteralsOffset + kIntSize; | 6735 kNumLiteralsOffset + kIntSize; |
| 6703 static const int kStartPositionAndTypeOffset = | 6736 static const int kStartPositionAndTypeOffset = |
| 6704 kEndPositionOffset + kIntSize; | 6737 kEndPositionOffset + kIntSize; |
| 6705 | 6738 |
| 6706 static const int kFunctionTokenPositionOffset = | 6739 static const int kFunctionTokenPositionOffset = |
| 6707 kStartPositionAndTypeOffset + kIntSize; | 6740 kStartPositionAndTypeOffset + kIntSize; |
| 6708 static const int kCompilerHintsOffset = | 6741 static const int kCompilerHintsOffset = |
| 6709 kFunctionTokenPositionOffset + kIntSize; | 6742 kFunctionTokenPositionOffset + kIntSize; |
| 6710 | 6743 |
| 6711 static const int kOptCountOffset = kCompilerHintsOffset + kIntSize; | 6744 static const int kOptCountAndBailoutReasonOffset = |
| 6745 kCompilerHintsOffset + kIntSize; |
| 6712 | 6746 |
| 6713 static const int kCountersOffset = kOptCountOffset + kIntSize; | 6747 static const int kCountersOffset = |
| 6748 kOptCountAndBailoutReasonOffset + kIntSize; |
| 6714 | 6749 |
| 6715 // Total size. | 6750 // Total size. |
| 6716 static const int kSize = kCountersOffset + kIntSize; | 6751 static const int kSize = kCountersOffset + kIntSize; |
| 6717 | 6752 |
| 6718 #endif | 6753 #endif |
| 6719 | 6754 |
| 6720 // The construction counter for inobject slack tracking is stored in the | 6755 // The construction counter for inobject slack tracking is stored in the |
| 6721 // most significant byte of compiler_hints which is otherwise unused. | 6756 // most significant byte of compiler_hints which is otherwise unused. |
| 6722 // Its offset depends on the endian-ness of the architecture. | 6757 // Its offset depends on the endian-ness of the architecture. |
| 6723 #if __BYTE_ORDER == __LITTLE_ENDIAN | 6758 #if __BYTE_ORDER == __LITTLE_ENDIAN |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6762 kDontCache, | 6797 kDontCache, |
| 6763 kDontFlush, | 6798 kDontFlush, |
| 6764 kIsGenerator, | 6799 kIsGenerator, |
| 6765 kCompilerHintsCount // Pseudo entry | 6800 kCompilerHintsCount // Pseudo entry |
| 6766 }; | 6801 }; |
| 6767 | 6802 |
| 6768 class DeoptCountBits: public BitField<int, 0, 4> {}; | 6803 class DeoptCountBits: public BitField<int, 0, 4> {}; |
| 6769 class OptReenableTriesBits: public BitField<int, 4, 18> {}; | 6804 class OptReenableTriesBits: public BitField<int, 4, 18> {}; |
| 6770 class ICAgeBits: public BitField<int, 22, 8> {}; | 6805 class ICAgeBits: public BitField<int, 22, 8> {}; |
| 6771 | 6806 |
| 6807 class OptCountBits: public BitField<int, 0, 22> {}; |
| 6808 class DisabledOptimizationReasonBits: public BitField<int, 22, 8> {}; |
| 6809 |
| 6772 private: | 6810 private: |
| 6773 #if V8_HOST_ARCH_32_BIT | 6811 #if V8_HOST_ARCH_32_BIT |
| 6774 // On 32 bit platforms, compiler hints is a smi. | 6812 // On 32 bit platforms, compiler hints is a smi. |
| 6775 static const int kCompilerHintsSmiTagSize = kSmiTagSize; | 6813 static const int kCompilerHintsSmiTagSize = kSmiTagSize; |
| 6776 static const int kCompilerHintsSize = kPointerSize; | 6814 static const int kCompilerHintsSize = kPointerSize; |
| 6777 #else | 6815 #else |
| 6778 // On 64 bit platforms, compiler hints is not a smi, see comment above. | 6816 // On 64 bit platforms, compiler hints is not a smi, see comment above. |
| 6779 static const int kCompilerHintsSmiTagSize = 0; | 6817 static const int kCompilerHintsSmiTagSize = 0; |
| 6780 static const int kCompilerHintsSize = kIntSize; | 6818 static const int kCompilerHintsSize = kIntSize; |
| 6781 #endif | 6819 #endif |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7031 // not have one. Note that this method does not copy the initial map | 7069 // not have one. Note that this method does not copy the initial map |
| 7032 // if it has one already, but simply replaces it with the new value. | 7070 // if it has one already, but simply replaces it with the new value. |
| 7033 // Instances created afterwards will have a map whose [[class]] is | 7071 // Instances created afterwards will have a map whose [[class]] is |
| 7034 // set to 'value', but there is no guarantees on instances created | 7072 // set to 'value', but there is no guarantees on instances created |
| 7035 // before. | 7073 // before. |
| 7036 void SetInstanceClassName(String* name); | 7074 void SetInstanceClassName(String* name); |
| 7037 | 7075 |
| 7038 // Returns if this function has been compiled to native code yet. | 7076 // Returns if this function has been compiled to native code yet. |
| 7039 inline bool is_compiled(); | 7077 inline bool is_compiled(); |
| 7040 | 7078 |
| 7041 // [next_function_link]: Field for linking functions. This list is treated as | 7079 // [next_function_link]: Links functions into various lists, e.g. the list |
| 7042 // a weak list by the GC. | 7080 // of optimized functions hanging off the native_context. The CodeFlusher |
| 7081 // uses this link to chain together flushing candidates. Treated weakly |
| 7082 // by the garbage collector. |
| 7043 DECL_ACCESSORS(next_function_link, Object) | 7083 DECL_ACCESSORS(next_function_link, Object) |
| 7044 | 7084 |
| 7045 // Prints the name of the function using PrintF. | 7085 // Prints the name of the function using PrintF. |
| 7046 void PrintName(FILE* out = stdout); | 7086 void PrintName(FILE* out = stdout); |
| 7047 | 7087 |
| 7048 // Casting. | 7088 // Casting. |
| 7049 static inline JSFunction* cast(Object* obj); | 7089 static inline JSFunction* cast(Object* obj); |
| 7050 | 7090 |
| 7051 // Iterates the objects, including code objects indirectly referenced | 7091 // Iterates the objects, including code objects indirectly referenced |
| 7052 // through pointers to the first instruction in the code object. | 7092 // through pointers to the first instruction in the code object. |
| (...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8737 // Utility superclass for stack-allocated objects that must be updated | 8777 // Utility superclass for stack-allocated objects that must be updated |
| 8738 // on gc. It provides two ways for the gc to update instances, either | 8778 // on gc. It provides two ways for the gc to update instances, either |
| 8739 // iterating or updating after gc. | 8779 // iterating or updating after gc. |
| 8740 class Relocatable BASE_EMBEDDED { | 8780 class Relocatable BASE_EMBEDDED { |
| 8741 public: | 8781 public: |
| 8742 explicit inline Relocatable(Isolate* isolate); | 8782 explicit inline Relocatable(Isolate* isolate); |
| 8743 inline virtual ~Relocatable(); | 8783 inline virtual ~Relocatable(); |
| 8744 virtual void IterateInstance(ObjectVisitor* v) { } | 8784 virtual void IterateInstance(ObjectVisitor* v) { } |
| 8745 virtual void PostGarbageCollection() { } | 8785 virtual void PostGarbageCollection() { } |
| 8746 | 8786 |
| 8747 static void PostGarbageCollectionProcessing(); | 8787 static void PostGarbageCollectionProcessing(Isolate* isolate); |
| 8748 static int ArchiveSpacePerThread(); | 8788 static int ArchiveSpacePerThread(); |
| 8749 static char* ArchiveState(Isolate* isolate, char* to); | 8789 static char* ArchiveState(Isolate* isolate, char* to); |
| 8750 static char* RestoreState(Isolate* isolate, char* from); | 8790 static char* RestoreState(Isolate* isolate, char* from); |
| 8751 static void Iterate(ObjectVisitor* v); | 8791 static void Iterate(Isolate* isolate, ObjectVisitor* v); |
| 8752 static void Iterate(ObjectVisitor* v, Relocatable* top); | 8792 static void Iterate(ObjectVisitor* v, Relocatable* top); |
| 8753 static char* Iterate(ObjectVisitor* v, char* t); | 8793 static char* Iterate(ObjectVisitor* v, char* t); |
| 8794 |
| 8754 private: | 8795 private: |
| 8755 Isolate* isolate_; | 8796 Isolate* isolate_; |
| 8756 Relocatable* prev_; | 8797 Relocatable* prev_; |
| 8757 }; | 8798 }; |
| 8758 | 8799 |
| 8759 | 8800 |
| 8760 // A flat string reader provides random access to the contents of a | 8801 // A flat string reader provides random access to the contents of a |
| 8761 // string independent of the character width of the string. The handle | 8802 // string independent of the character width of the string. The handle |
| 8762 // must be valid as long as the reader is being used. | 8803 // must be valid as long as the reader is being used. |
| 8763 class FlatStringReader : public Relocatable { | 8804 class FlatStringReader : public Relocatable { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8879 inline byte kind(); | 8920 inline byte kind(); |
| 8880 inline void set_kind(byte kind); | 8921 inline void set_kind(byte kind); |
| 8881 | 8922 |
| 8882 // Casting. | 8923 // Casting. |
| 8883 static inline Oddball* cast(Object* obj); | 8924 static inline Oddball* cast(Object* obj); |
| 8884 | 8925 |
| 8885 // Dispatched behavior. | 8926 // Dispatched behavior. |
| 8886 DECLARE_VERIFIER(Oddball) | 8927 DECLARE_VERIFIER(Oddball) |
| 8887 | 8928 |
| 8888 // Initialize the fields. | 8929 // Initialize the fields. |
| 8889 MUST_USE_RESULT MaybeObject* Initialize(const char* to_string, | 8930 MUST_USE_RESULT MaybeObject* Initialize(Heap* heap, |
| 8931 const char* to_string, |
| 8890 Object* to_number, | 8932 Object* to_number, |
| 8891 byte kind); | 8933 byte kind); |
| 8892 | 8934 |
| 8893 // Layout description. | 8935 // Layout description. |
| 8894 static const int kToStringOffset = HeapObject::kHeaderSize; | 8936 static const int kToStringOffset = HeapObject::kHeaderSize; |
| 8895 static const int kToNumberOffset = kToStringOffset + kPointerSize; | 8937 static const int kToNumberOffset = kToStringOffset + kPointerSize; |
| 8896 static const int kKindOffset = kToNumberOffset + kPointerSize; | 8938 static const int kKindOffset = kToNumberOffset + kPointerSize; |
| 8897 static const int kSize = kKindOffset + kPointerSize; | 8939 static const int kSize = kKindOffset + kPointerSize; |
| 8898 | 8940 |
| 8899 static const byte kFalse = 0; | 8941 static const byte kFalse = 0; |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9502 inline void set_property_attributes(PropertyAttributes attributes); | 9544 inline void set_property_attributes(PropertyAttributes attributes); |
| 9503 | 9545 |
| 9504 // Checks whether the given receiver is compatible with this accessor. | 9546 // Checks whether the given receiver is compatible with this accessor. |
| 9505 inline bool IsCompatibleReceiver(Object* receiver); | 9547 inline bool IsCompatibleReceiver(Object* receiver); |
| 9506 | 9548 |
| 9507 static inline AccessorInfo* cast(Object* obj); | 9549 static inline AccessorInfo* cast(Object* obj); |
| 9508 | 9550 |
| 9509 // Dispatched behavior. | 9551 // Dispatched behavior. |
| 9510 DECLARE_VERIFIER(AccessorInfo) | 9552 DECLARE_VERIFIER(AccessorInfo) |
| 9511 | 9553 |
| 9554 // Append all descriptors to the array that are not already there. |
| 9555 // Return number added. |
| 9556 static int AppendUnique(Handle<Object> descriptors, |
| 9557 Handle<FixedArray> array, |
| 9558 int valid_descriptors); |
| 9512 | 9559 |
| 9513 static const int kNameOffset = HeapObject::kHeaderSize; | 9560 static const int kNameOffset = HeapObject::kHeaderSize; |
| 9514 static const int kFlagOffset = kNameOffset + kPointerSize; | 9561 static const int kFlagOffset = kNameOffset + kPointerSize; |
| 9515 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 9562 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; |
| 9516 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; | 9563 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; |
| 9517 | 9564 |
| 9518 private: | 9565 private: |
| 9519 // Bit positions in flag. | 9566 // Bit positions in flag. |
| 9520 static const int kAllCanReadBit = 0; | 9567 static const int kAllCanReadBit = 0; |
| 9521 static const int kAllCanWriteBit = 1; | 9568 static const int kAllCanWriteBit = 1; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9808 | 9855 |
| 9809 private: | 9856 private: |
| 9810 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo); | 9857 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo); |
| 9811 }; | 9858 }; |
| 9812 | 9859 |
| 9813 | 9860 |
| 9814 class TemplateInfo: public Struct { | 9861 class TemplateInfo: public Struct { |
| 9815 public: | 9862 public: |
| 9816 DECL_ACCESSORS(tag, Object) | 9863 DECL_ACCESSORS(tag, Object) |
| 9817 DECL_ACCESSORS(property_list, Object) | 9864 DECL_ACCESSORS(property_list, Object) |
| 9865 DECL_ACCESSORS(property_accessors, Object) |
| 9818 | 9866 |
| 9819 DECLARE_VERIFIER(TemplateInfo) | 9867 DECLARE_VERIFIER(TemplateInfo) |
| 9820 | 9868 |
| 9821 static const int kTagOffset = HeapObject::kHeaderSize; | 9869 static const int kTagOffset = HeapObject::kHeaderSize; |
| 9822 static const int kPropertyListOffset = kTagOffset + kPointerSize; | 9870 static const int kPropertyListOffset = kTagOffset + kPointerSize; |
| 9823 static const int kHeaderSize = kPropertyListOffset + kPointerSize; | 9871 static const int kPropertyAccessorsOffset = |
| 9872 kPropertyListOffset + kPointerSize; |
| 9873 static const int kHeaderSize = kPropertyAccessorsOffset + kPointerSize; |
| 9824 | 9874 |
| 9825 private: | 9875 private: |
| 9826 DISALLOW_IMPLICIT_CONSTRUCTORS(TemplateInfo); | 9876 DISALLOW_IMPLICIT_CONSTRUCTORS(TemplateInfo); |
| 9827 }; | 9877 }; |
| 9828 | 9878 |
| 9829 | 9879 |
| 9830 class FunctionTemplateInfo: public TemplateInfo { | 9880 class FunctionTemplateInfo: public TemplateInfo { |
| 9831 public: | 9881 public: |
| 9832 DECL_ACCESSORS(serial_number, Object) | 9882 DECL_ACCESSORS(serial_number, Object) |
| 9833 DECL_ACCESSORS(call_code, Object) | 9883 DECL_ACCESSORS(call_code, Object) |
| 9834 DECL_ACCESSORS(property_accessors, Object) | |
| 9835 DECL_ACCESSORS(prototype_template, Object) | 9884 DECL_ACCESSORS(prototype_template, Object) |
| 9836 DECL_ACCESSORS(parent_template, Object) | 9885 DECL_ACCESSORS(parent_template, Object) |
| 9837 DECL_ACCESSORS(named_property_handler, Object) | 9886 DECL_ACCESSORS(named_property_handler, Object) |
| 9838 DECL_ACCESSORS(indexed_property_handler, Object) | 9887 DECL_ACCESSORS(indexed_property_handler, Object) |
| 9839 DECL_ACCESSORS(instance_template, Object) | 9888 DECL_ACCESSORS(instance_template, Object) |
| 9840 DECL_ACCESSORS(class_name, Object) | 9889 DECL_ACCESSORS(class_name, Object) |
| 9841 DECL_ACCESSORS(signature, Object) | 9890 DECL_ACCESSORS(signature, Object) |
| 9842 DECL_ACCESSORS(instance_call_handler, Object) | 9891 DECL_ACCESSORS(instance_call_handler, Object) |
| 9843 DECL_ACCESSORS(access_check_info, Object) | 9892 DECL_ACCESSORS(access_check_info, Object) |
| 9844 DECL_ACCESSORS(flag, Smi) | 9893 DECL_ACCESSORS(flag, Smi) |
| 9845 | 9894 |
| 9846 inline int length(); | 9895 inline int length(); |
| 9847 inline void set_length(int value); | 9896 inline void set_length(int value); |
| 9848 | 9897 |
| 9849 // Following properties use flag bits. | 9898 // Following properties use flag bits. |
| 9850 DECL_BOOLEAN_ACCESSORS(hidden_prototype) | 9899 DECL_BOOLEAN_ACCESSORS(hidden_prototype) |
| 9851 DECL_BOOLEAN_ACCESSORS(undetectable) | 9900 DECL_BOOLEAN_ACCESSORS(undetectable) |
| 9852 // If the bit is set, object instances created by this function | 9901 // If the bit is set, object instances created by this function |
| 9853 // requires access check. | 9902 // requires access check. |
| 9854 DECL_BOOLEAN_ACCESSORS(needs_access_check) | 9903 DECL_BOOLEAN_ACCESSORS(needs_access_check) |
| 9855 DECL_BOOLEAN_ACCESSORS(read_only_prototype) | 9904 DECL_BOOLEAN_ACCESSORS(read_only_prototype) |
| 9856 DECL_BOOLEAN_ACCESSORS(remove_prototype) | 9905 DECL_BOOLEAN_ACCESSORS(remove_prototype) |
| 9906 DECL_BOOLEAN_ACCESSORS(do_not_cache) |
| 9857 | 9907 |
| 9858 static inline FunctionTemplateInfo* cast(Object* obj); | 9908 static inline FunctionTemplateInfo* cast(Object* obj); |
| 9859 | 9909 |
| 9860 // Dispatched behavior. | 9910 // Dispatched behavior. |
| 9861 DECLARE_PRINTER(FunctionTemplateInfo) | 9911 DECLARE_PRINTER(FunctionTemplateInfo) |
| 9862 DECLARE_VERIFIER(FunctionTemplateInfo) | 9912 DECLARE_VERIFIER(FunctionTemplateInfo) |
| 9863 | 9913 |
| 9864 static const int kSerialNumberOffset = TemplateInfo::kHeaderSize; | 9914 static const int kSerialNumberOffset = TemplateInfo::kHeaderSize; |
| 9865 static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize; | 9915 static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize; |
| 9866 static const int kPropertyAccessorsOffset = kCallCodeOffset + kPointerSize; | |
| 9867 static const int kPrototypeTemplateOffset = | 9916 static const int kPrototypeTemplateOffset = |
| 9868 kPropertyAccessorsOffset + kPointerSize; | 9917 kCallCodeOffset + kPointerSize; |
| 9869 static const int kParentTemplateOffset = | 9918 static const int kParentTemplateOffset = |
| 9870 kPrototypeTemplateOffset + kPointerSize; | 9919 kPrototypeTemplateOffset + kPointerSize; |
| 9871 static const int kNamedPropertyHandlerOffset = | 9920 static const int kNamedPropertyHandlerOffset = |
| 9872 kParentTemplateOffset + kPointerSize; | 9921 kParentTemplateOffset + kPointerSize; |
| 9873 static const int kIndexedPropertyHandlerOffset = | 9922 static const int kIndexedPropertyHandlerOffset = |
| 9874 kNamedPropertyHandlerOffset + kPointerSize; | 9923 kNamedPropertyHandlerOffset + kPointerSize; |
| 9875 static const int kInstanceTemplateOffset = | 9924 static const int kInstanceTemplateOffset = |
| 9876 kIndexedPropertyHandlerOffset + kPointerSize; | 9925 kIndexedPropertyHandlerOffset + kPointerSize; |
| 9877 static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize; | 9926 static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize; |
| 9878 static const int kSignatureOffset = kClassNameOffset + kPointerSize; | 9927 static const int kSignatureOffset = kClassNameOffset + kPointerSize; |
| 9879 static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize; | 9928 static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize; |
| 9880 static const int kAccessCheckInfoOffset = | 9929 static const int kAccessCheckInfoOffset = |
| 9881 kInstanceCallHandlerOffset + kPointerSize; | 9930 kInstanceCallHandlerOffset + kPointerSize; |
| 9882 static const int kFlagOffset = kAccessCheckInfoOffset + kPointerSize; | 9931 static const int kFlagOffset = kAccessCheckInfoOffset + kPointerSize; |
| 9883 static const int kLengthOffset = kFlagOffset + kPointerSize; | 9932 static const int kLengthOffset = kFlagOffset + kPointerSize; |
| 9884 static const int kSize = kLengthOffset + kPointerSize; | 9933 static const int kSize = kLengthOffset + kPointerSize; |
| 9885 | 9934 |
| 9886 private: | 9935 private: |
| 9887 // Bit position in the flag, from least significant bit position. | 9936 // Bit position in the flag, from least significant bit position. |
| 9888 static const int kHiddenPrototypeBit = 0; | 9937 static const int kHiddenPrototypeBit = 0; |
| 9889 static const int kUndetectableBit = 1; | 9938 static const int kUndetectableBit = 1; |
| 9890 static const int kNeedsAccessCheckBit = 2; | 9939 static const int kNeedsAccessCheckBit = 2; |
| 9891 static const int kReadOnlyPrototypeBit = 3; | 9940 static const int kReadOnlyPrototypeBit = 3; |
| 9892 static const int kRemovePrototypeBit = 4; | 9941 static const int kRemovePrototypeBit = 4; |
| 9942 static const int kDoNotCacheBit = 5; |
| 9893 | 9943 |
| 9894 DISALLOW_IMPLICIT_CONSTRUCTORS(FunctionTemplateInfo); | 9944 DISALLOW_IMPLICIT_CONSTRUCTORS(FunctionTemplateInfo); |
| 9895 }; | 9945 }; |
| 9896 | 9946 |
| 9897 | 9947 |
| 9898 class ObjectTemplateInfo: public TemplateInfo { | 9948 class ObjectTemplateInfo: public TemplateInfo { |
| 9899 public: | 9949 public: |
| 9900 DECL_ACCESSORS(constructor, Object) | 9950 DECL_ACCESSORS(constructor, Object) |
| 9901 DECL_ACCESSORS(internal_field_count, Object) | 9951 DECL_ACCESSORS(internal_field_count, Object) |
| 9902 | 9952 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10185 } else { | 10235 } else { |
| 10186 value &= ~(1 << bit_position); | 10236 value &= ~(1 << bit_position); |
| 10187 } | 10237 } |
| 10188 return value; | 10238 return value; |
| 10189 } | 10239 } |
| 10190 }; | 10240 }; |
| 10191 | 10241 |
| 10192 } } // namespace v8::internal | 10242 } } // namespace v8::internal |
| 10193 | 10243 |
| 10194 #endif // V8_OBJECTS_H_ | 10244 #endif // V8_OBJECTS_H_ |
| OLD | NEW |