| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 V(Map, byte_array_map, ByteArrayMap) \ | 52 V(Map, byte_array_map, ByteArrayMap) \ |
| 53 V(Map, one_pointer_filler_map, OnePointerFillerMap) \ | 53 V(Map, one_pointer_filler_map, OnePointerFillerMap) \ |
| 54 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \ | 54 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \ |
| 55 /* Cluster the most popular ones in a few cache lines here at the top. */ \ | 55 /* Cluster the most popular ones in a few cache lines here at the top. */ \ |
| 56 V(Smi, stack_limit, StackLimit) \ | 56 V(Smi, stack_limit, StackLimit) \ |
| 57 V(Object, undefined_value, UndefinedValue) \ | 57 V(Object, undefined_value, UndefinedValue) \ |
| 58 V(Object, the_hole_value, TheHoleValue) \ | 58 V(Object, the_hole_value, TheHoleValue) \ |
| 59 V(Object, null_value, NullValue) \ | 59 V(Object, null_value, NullValue) \ |
| 60 V(Object, true_value, TrueValue) \ | 60 V(Object, true_value, TrueValue) \ |
| 61 V(Object, false_value, FalseValue) \ | 61 V(Object, false_value, FalseValue) \ |
| 62 V(Object, arguments_marker, ArgumentsMarker) \ |
| 62 V(Map, heap_number_map, HeapNumberMap) \ | 63 V(Map, heap_number_map, HeapNumberMap) \ |
| 63 V(Map, global_context_map, GlobalContextMap) \ | 64 V(Map, global_context_map, GlobalContextMap) \ |
| 64 V(Map, fixed_array_map, FixedArrayMap) \ | 65 V(Map, fixed_array_map, FixedArrayMap) \ |
| 65 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ | 66 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ |
| 66 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ | 67 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ |
| 67 V(Map, meta_map, MetaMap) \ | 68 V(Map, meta_map, MetaMap) \ |
| 68 V(Object, termination_exception, TerminationException) \ | 69 V(Object, termination_exception, TerminationException) \ |
| 69 V(Map, hash_table_map, HashTableMap) \ | 70 V(Map, hash_table_map, HashTableMap) \ |
| 70 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ | 71 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ |
| 71 V(ByteArray, empty_byte_array, EmptyByteArray) \ | 72 V(ByteArray, empty_byte_array, EmptyByteArray) \ |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 PretenureFlag pretenure = NOT_TENURED); | 502 PretenureFlag pretenure = NOT_TENURED); |
| 502 | 503 |
| 503 // Allocates a symbol in old space based on the character stream. | 504 // Allocates a symbol in old space based on the character stream. |
| 504 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 505 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| 505 // failed. | 506 // failed. |
| 506 // Please note this function does not perform a garbage collection. | 507 // Please note this function does not perform a garbage collection. |
| 507 MUST_USE_RESULT inline MaybeObject* AllocateSymbol(Vector<const char> str, | 508 MUST_USE_RESULT inline MaybeObject* AllocateSymbol(Vector<const char> str, |
| 508 int chars, | 509 int chars, |
| 509 uint32_t hash_field); | 510 uint32_t hash_field); |
| 510 | 511 |
| 512 MUST_USE_RESULT inline MaybeObject* AllocateAsciiSymbol( |
| 513 Vector<const char> str, |
| 514 uint32_t hash_field); |
| 515 |
| 516 MUST_USE_RESULT inline MaybeObject* AllocateTwoByteSymbol( |
| 517 Vector<const uc16> str, |
| 518 uint32_t hash_field); |
| 519 |
| 511 MUST_USE_RESULT MaybeObject* AllocateInternalSymbol( | 520 MUST_USE_RESULT MaybeObject* AllocateInternalSymbol( |
| 512 unibrow::CharacterStream* buffer, int chars, uint32_t hash_field); | 521 unibrow::CharacterStream* buffer, int chars, uint32_t hash_field); |
| 513 | 522 |
| 514 MUST_USE_RESULT MaybeObject* AllocateExternalSymbol( | 523 MUST_USE_RESULT MaybeObject* AllocateExternalSymbol( |
| 515 Vector<const char> str, | 524 Vector<const char> str, |
| 516 int chars); | 525 int chars); |
| 517 | 526 |
| 518 // Allocates and partially initializes a String. There are two String | 527 // Allocates and partially initializes a String. There are two String |
| 519 // encodings: ASCII and two byte. These functions allocate a string of the | 528 // encodings: ASCII and two byte. These functions allocate a string of the |
| 520 // given length and set its map and length fields. The characters of the | 529 // given length and set its map and length fields. The characters of the |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 // Copy the code and scope info part of the code object, but insert | 755 // Copy the code and scope info part of the code object, but insert |
| 747 // the provided data as the relocation information. | 756 // the provided data as the relocation information. |
| 748 MUST_USE_RESULT MaybeObject* CopyCode(Code* code, Vector<byte> reloc_info); | 757 MUST_USE_RESULT MaybeObject* CopyCode(Code* code, Vector<byte> reloc_info); |
| 749 | 758 |
| 750 // Finds the symbol for string in the symbol table. | 759 // Finds the symbol for string in the symbol table. |
| 751 // If not found, a new symbol is added to the table and returned. | 760 // If not found, a new symbol is added to the table and returned. |
| 752 // Returns Failure::RetryAfterGC(requested_bytes, space) if allocation | 761 // Returns Failure::RetryAfterGC(requested_bytes, space) if allocation |
| 753 // failed. | 762 // failed. |
| 754 // Please note this function does not perform a garbage collection. | 763 // Please note this function does not perform a garbage collection. |
| 755 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str); | 764 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str); |
| 765 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Vector<const char> str); |
| 766 MUST_USE_RESULT MaybeObject* LookupTwoByteSymbol( |
| 767 Vector<const uc16> str); |
| 756 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(const char* str) { | 768 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(const char* str) { |
| 757 return LookupSymbol(CStrVector(str)); | 769 return LookupSymbol(CStrVector(str)); |
| 758 } | 770 } |
| 759 MUST_USE_RESULT MaybeObject* LookupSymbol(String* str); | 771 MUST_USE_RESULT MaybeObject* LookupSymbol(String* str); |
| 760 bool LookupSymbolIfExists(String* str, String** symbol); | 772 bool LookupSymbolIfExists(String* str, String** symbol); |
| 761 bool LookupTwoCharsSymbolIfExists(String* str, String** symbol); | 773 bool LookupTwoCharsSymbolIfExists(String* str, String** symbol); |
| 762 | 774 |
| 763 // Compute the matching symbol map for a string if possible. | 775 // Compute the matching symbol map for a string if possible. |
| 764 // NULL is returned if string is in new space or not flattened. | 776 // NULL is returned if string is in new space or not flattened. |
| 765 Map* SymbolMapForString(String* str); | 777 Map* SymbolMapForString(String* str); |
| (...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1961 kNumberOfScopes | 1973 kNumberOfScopes |
| 1962 }; | 1974 }; |
| 1963 | 1975 |
| 1964 Scope(GCTracer* tracer, ScopeId scope) | 1976 Scope(GCTracer* tracer, ScopeId scope) |
| 1965 : tracer_(tracer), | 1977 : tracer_(tracer), |
| 1966 scope_(scope) { | 1978 scope_(scope) { |
| 1967 start_time_ = OS::TimeCurrentMillis(); | 1979 start_time_ = OS::TimeCurrentMillis(); |
| 1968 } | 1980 } |
| 1969 | 1981 |
| 1970 ~Scope() { | 1982 ~Scope() { |
| 1971 ASSERT((0 <= scope_) && (scope_ < kNumberOfScopes)); | 1983 ASSERT(scope_ < kNumberOfScopes); // scope_ is unsigned. |
| 1972 tracer_->scopes_[scope_] += OS::TimeCurrentMillis() - start_time_; | 1984 tracer_->scopes_[scope_] += OS::TimeCurrentMillis() - start_time_; |
| 1973 } | 1985 } |
| 1974 | 1986 |
| 1975 private: | 1987 private: |
| 1976 GCTracer* tracer_; | 1988 GCTracer* tracer_; |
| 1977 ScopeId scope_; | 1989 ScopeId scope_; |
| 1978 double start_time_; | 1990 double start_time_; |
| 1979 }; | 1991 }; |
| 1980 | 1992 |
| 1981 explicit GCTracer(Heap* heap); | 1993 explicit GCTracer(Heap* heap); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2147 // should be returned as in some GC situations the object has been moved. | 2159 // should be returned as in some GC situations the object has been moved. |
| 2148 virtual Object* RetainAs(Object* object) = 0; | 2160 virtual Object* RetainAs(Object* object) = 0; |
| 2149 }; | 2161 }; |
| 2150 | 2162 |
| 2151 | 2163 |
| 2152 } } // namespace v8::internal | 2164 } } // namespace v8::internal |
| 2153 | 2165 |
| 2154 #undef HEAP | 2166 #undef HEAP |
| 2155 | 2167 |
| 2156 #endif // V8_HEAP_H_ | 2168 #endif // V8_HEAP_H_ |
| OLD | NEW |