| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
| 6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 // Clients of this interface shouldn't depend on lots of heap internals. | 11 // Clients of this interface shouldn't depend on lots of heap internals. |
| 12 // Do not include anything from src/heap here! | 12 // Do not include anything from src/heap here! |
| 13 #include "src/allocation.h" | 13 #include "src/allocation.h" |
| 14 #include "src/assert-scope.h" | 14 #include "src/assert-scope.h" |
| 15 #include "src/atomic-utils.h" | 15 #include "src/atomic-utils.h" |
| 16 #include "src/globals.h" | 16 #include "src/globals.h" |
| 17 #include "src/heap-symbols.h" |
| 17 // TODO(mstarzinger): Two more includes to kill! | 18 // TODO(mstarzinger): Two more includes to kill! |
| 18 #include "src/heap/spaces.h" | 19 #include "src/heap/spaces.h" |
| 19 #include "src/heap/store-buffer.h" | 20 #include "src/heap/store-buffer.h" |
| 20 #include "src/list.h" | 21 #include "src/list.h" |
| 21 | 22 |
| 22 namespace v8 { | 23 namespace v8 { |
| 23 namespace internal { | 24 namespace internal { |
| 24 | 25 |
| 25 // Defines all the roots in Heap. | 26 // Defines all the roots in Heap. |
| 26 #define STRONG_ROOT_LIST(V) \ | 27 #define STRONG_ROOT_LIST(V) \ |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 V(Smi, construct_stub_deopt_pc_offset, ConstructStubDeoptPCOffset) \ | 203 V(Smi, construct_stub_deopt_pc_offset, ConstructStubDeoptPCOffset) \ |
| 203 V(Smi, getter_stub_deopt_pc_offset, GetterStubDeoptPCOffset) \ | 204 V(Smi, getter_stub_deopt_pc_offset, GetterStubDeoptPCOffset) \ |
| 204 V(Smi, setter_stub_deopt_pc_offset, SetterStubDeoptPCOffset) | 205 V(Smi, setter_stub_deopt_pc_offset, SetterStubDeoptPCOffset) |
| 205 | 206 |
| 206 | 207 |
| 207 #define ROOT_LIST(V) \ | 208 #define ROOT_LIST(V) \ |
| 208 STRONG_ROOT_LIST(V) \ | 209 STRONG_ROOT_LIST(V) \ |
| 209 SMI_ROOT_LIST(V) \ | 210 SMI_ROOT_LIST(V) \ |
| 210 V(StringTable, string_table, StringTable) | 211 V(StringTable, string_table, StringTable) |
| 211 | 212 |
| 212 #define INTERNALIZED_STRING_LIST(V) \ | |
| 213 V(anonymous_string, "anonymous") \ | |
| 214 V(apply_string, "apply") \ | |
| 215 V(assign_string, "assign") \ | |
| 216 V(arguments_string, "arguments") \ | |
| 217 V(Arguments_string, "Arguments") \ | |
| 218 V(Array_string, "Array") \ | |
| 219 V(bind_string, "bind") \ | |
| 220 V(bool16x8_string, "bool16x8") \ | |
| 221 V(Bool16x8_string, "Bool16x8") \ | |
| 222 V(bool32x4_string, "bool32x4") \ | |
| 223 V(Bool32x4_string, "Bool32x4") \ | |
| 224 V(bool8x16_string, "bool8x16") \ | |
| 225 V(Bool8x16_string, "Bool8x16") \ | |
| 226 V(boolean_string, "boolean") \ | |
| 227 V(Boolean_string, "Boolean") \ | |
| 228 V(bound__string, "bound ") \ | |
| 229 V(byte_length_string, "byteLength") \ | |
| 230 V(byte_offset_string, "byteOffset") \ | |
| 231 V(call_string, "call") \ | |
| 232 V(callee_string, "callee") \ | |
| 233 V(caller_string, "caller") \ | |
| 234 V(cell_value_string, "%cell_value") \ | |
| 235 V(char_at_string, "CharAt") \ | |
| 236 V(closure_string, "(closure)") \ | |
| 237 V(compare_ic_string, "==") \ | |
| 238 V(configurable_string, "configurable") \ | |
| 239 V(constructor_string, "constructor") \ | |
| 240 V(construct_string, "construct") \ | |
| 241 V(create_string, "create") \ | |
| 242 V(Date_string, "Date") \ | |
| 243 V(default_string, "default") \ | |
| 244 V(defineProperty_string, "defineProperty") \ | |
| 245 V(deleteProperty_string, "deleteProperty") \ | |
| 246 V(display_name_string, "displayName") \ | |
| 247 V(done_string, "done") \ | |
| 248 V(dot_result_string, ".result") \ | |
| 249 V(dot_string, ".") \ | |
| 250 V(entries_string, "entries") \ | |
| 251 V(enumerable_string, "enumerable") \ | |
| 252 V(enumerate_string, "enumerate") \ | |
| 253 V(Error_string, "Error") \ | |
| 254 V(eval_string, "eval") \ | |
| 255 V(false_string, "false") \ | |
| 256 V(float32x4_string, "float32x4") \ | |
| 257 V(Float32x4_string, "Float32x4") \ | |
| 258 V(for_api_string, "for_api") \ | |
| 259 V(for_string, "for") \ | |
| 260 V(function_string, "function") \ | |
| 261 V(Function_string, "Function") \ | |
| 262 V(Generator_string, "Generator") \ | |
| 263 V(getOwnPropertyDescriptor_string, "getOwnPropertyDescriptor") \ | |
| 264 V(getPrototypeOf_string, "getPrototypeOf") \ | |
| 265 V(get_string, "get") \ | |
| 266 V(global_string, "global") \ | |
| 267 V(has_string, "has") \ | |
| 268 V(illegal_access_string, "illegal access") \ | |
| 269 V(illegal_argument_string, "illegal argument") \ | |
| 270 V(index_string, "index") \ | |
| 271 V(infinity_string, "Infinity") \ | |
| 272 V(input_string, "input") \ | |
| 273 V(int16x8_string, "int16x8") \ | |
| 274 V(Int16x8_string, "Int16x8") \ | |
| 275 V(int32x4_string, "int32x4") \ | |
| 276 V(Int32x4_string, "Int32x4") \ | |
| 277 V(int8x16_string, "int8x16") \ | |
| 278 V(Int8x16_string, "Int8x16") \ | |
| 279 V(isExtensible_string, "isExtensible") \ | |
| 280 V(isView_string, "isView") \ | |
| 281 V(KeyedLoadMonomorphic_string, "KeyedLoadMonomorphic") \ | |
| 282 V(KeyedStoreMonomorphic_string, "KeyedStoreMonomorphic") \ | |
| 283 V(last_index_string, "lastIndex") \ | |
| 284 V(length_string, "length") \ | |
| 285 V(Map_string, "Map") \ | |
| 286 V(minus_infinity_string, "-Infinity") \ | |
| 287 V(minus_zero_string, "-0") \ | |
| 288 V(name_string, "name") \ | |
| 289 V(nan_string, "NaN") \ | |
| 290 V(next_string, "next") \ | |
| 291 V(null_string, "null") \ | |
| 292 V(null_to_string, "[object Null]") \ | |
| 293 V(number_string, "number") \ | |
| 294 V(Number_string, "Number") \ | |
| 295 V(object_string, "object") \ | |
| 296 V(Object_string, "Object") \ | |
| 297 V(ownKeys_string, "ownKeys") \ | |
| 298 V(preventExtensions_string, "preventExtensions") \ | |
| 299 V(private_api_string, "private_api") \ | |
| 300 V(Promise_string, "Promise") \ | |
| 301 V(proto_string, "__proto__") \ | |
| 302 V(prototype_string, "prototype") \ | |
| 303 V(Proxy_string, "Proxy") \ | |
| 304 V(query_colon_string, "(?:)") \ | |
| 305 V(RegExp_string, "RegExp") \ | |
| 306 V(setPrototypeOf_string, "setPrototypeOf") \ | |
| 307 V(set_string, "set") \ | |
| 308 V(Set_string, "Set") \ | |
| 309 V(source_mapping_url_string, "source_mapping_url") \ | |
| 310 V(source_string, "source") \ | |
| 311 V(source_url_string, "source_url") \ | |
| 312 V(stack_string, "stack") \ | |
| 313 V(strict_compare_ic_string, "===") \ | |
| 314 V(string_string, "string") \ | |
| 315 V(String_string, "String") \ | |
| 316 V(symbol_string, "symbol") \ | |
| 317 V(Symbol_string, "Symbol") \ | |
| 318 V(this_string, "this") \ | |
| 319 V(throw_string, "throw") \ | |
| 320 V(toJSON_string, "toJSON") \ | |
| 321 V(toString_string, "toString") \ | |
| 322 V(true_string, "true") \ | |
| 323 V(uint16x8_string, "uint16x8") \ | |
| 324 V(Uint16x8_string, "Uint16x8") \ | |
| 325 V(uint32x4_string, "uint32x4") \ | |
| 326 V(Uint32x4_string, "Uint32x4") \ | |
| 327 V(uint8x16_string, "uint8x16") \ | |
| 328 V(Uint8x16_string, "Uint8x16") \ | |
| 329 V(undefined_string, "undefined") \ | |
| 330 V(undefined_to_string, "[object Undefined]") \ | |
| 331 V(valueOf_string, "valueOf") \ | |
| 332 V(values_string, "values") \ | |
| 333 V(value_string, "value") \ | |
| 334 V(WeakMap_string, "WeakMap") \ | |
| 335 V(WeakSet_string, "WeakSet") \ | |
| 336 V(writable_string, "writable") | |
| 337 | |
| 338 #define PRIVATE_SYMBOL_LIST(V) \ | |
| 339 V(array_iteration_kind_symbol) \ | |
| 340 V(array_iterator_next_symbol) \ | |
| 341 V(array_iterator_object_symbol) \ | |
| 342 V(call_site_function_symbol) \ | |
| 343 V(call_site_position_symbol) \ | |
| 344 V(call_site_receiver_symbol) \ | |
| 345 V(call_site_strict_symbol) \ | |
| 346 V(class_end_position_symbol) \ | |
| 347 V(class_start_position_symbol) \ | |
| 348 V(detailed_stack_trace_symbol) \ | |
| 349 V(elements_transition_symbol) \ | |
| 350 V(error_end_pos_symbol) \ | |
| 351 V(error_script_symbol) \ | |
| 352 V(error_start_pos_symbol) \ | |
| 353 V(formatted_stack_trace_symbol) \ | |
| 354 V(frozen_symbol) \ | |
| 355 V(hash_code_symbol) \ | |
| 356 V(home_object_symbol) \ | |
| 357 V(internal_error_symbol) \ | |
| 358 V(intl_impl_object_symbol) \ | |
| 359 V(intl_initialized_marker_symbol) \ | |
| 360 V(intl_pattern_symbol) \ | |
| 361 V(intl_resolved_symbol) \ | |
| 362 V(megamorphic_symbol) \ | |
| 363 V(native_context_index_symbol) \ | |
| 364 V(nonexistent_symbol) \ | |
| 365 V(nonextensible_symbol) \ | |
| 366 V(normal_ic_symbol) \ | |
| 367 V(not_mapped_symbol) \ | |
| 368 V(observed_symbol) \ | |
| 369 V(premonomorphic_symbol) \ | |
| 370 V(promise_combined_deferred_symbol) \ | |
| 371 V(promise_debug_marker_symbol) \ | |
| 372 V(promise_has_handler_symbol) \ | |
| 373 V(promise_on_resolve_symbol) \ | |
| 374 V(promise_on_reject_symbol) \ | |
| 375 V(promise_raw_symbol) \ | |
| 376 V(promise_status_symbol) \ | |
| 377 V(promise_value_symbol) \ | |
| 378 V(sealed_symbol) \ | |
| 379 V(stack_trace_symbol) \ | |
| 380 V(strict_function_transition_symbol) \ | |
| 381 V(string_iterator_iterated_string_symbol) \ | |
| 382 V(string_iterator_next_index_symbol) \ | |
| 383 V(strong_function_transition_symbol) \ | |
| 384 V(uninitialized_symbol) | |
| 385 | |
| 386 #define PUBLIC_SYMBOL_LIST(V) \ | |
| 387 V(has_instance_symbol, Symbol.hasInstance) \ | |
| 388 V(iterator_symbol, Symbol.iterator) \ | |
| 389 V(match_symbol, Symbol.match) \ | |
| 390 V(replace_symbol, Symbol.replace) \ | |
| 391 V(search_symbol, Symbol.search) \ | |
| 392 V(species_symbol, Symbol.species) \ | |
| 393 V(split_symbol, Symbol.split) \ | |
| 394 V(to_primitive_symbol, Symbol.toPrimitive) \ | |
| 395 V(unscopables_symbol, Symbol.unscopables) | |
| 396 | |
| 397 // Well-Known Symbols are "Public" symbols, which have a bit set which causes | |
| 398 // them to produce an undefined value when a load results in a failed access | |
| 399 // check. Because this behaviour is not specified properly as of yet, it only | |
| 400 // applies to a subset of spec-defined Well-Known Symbols. | |
| 401 #define WELL_KNOWN_SYMBOL_LIST(V) \ | |
| 402 V(is_concat_spreadable_symbol, Symbol.isConcatSpreadable) \ | |
| 403 V(to_string_tag_symbol, Symbol.toStringTag) | |
| 404 | 213 |
| 405 // Heap roots that are known to be immortal immovable, for which we can safely | 214 // Heap roots that are known to be immortal immovable, for which we can safely |
| 406 // skip write barriers. This list is not complete and has omissions. | 215 // skip write barriers. This list is not complete and has omissions. |
| 407 #define IMMORTAL_IMMOVABLE_ROOT_LIST(V) \ | 216 #define IMMORTAL_IMMOVABLE_ROOT_LIST(V) \ |
| 408 V(ByteArrayMap) \ | 217 V(ByteArrayMap) \ |
| 409 V(BytecodeArrayMap) \ | 218 V(BytecodeArrayMap) \ |
| 410 V(FreeSpaceMap) \ | 219 V(FreeSpaceMap) \ |
| 411 V(OnePointerFillerMap) \ | 220 V(OnePointerFillerMap) \ |
| 412 V(TwoPointerFillerMap) \ | 221 V(TwoPointerFillerMap) \ |
| 413 V(UndefinedValue) \ | 222 V(UndefinedValue) \ |
| (...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2844 | 2653 |
| 2845 private: | 2654 private: |
| 2846 friend class NewSpace; | 2655 friend class NewSpace; |
| 2847 DISALLOW_COPY_AND_ASSIGN(InlineAllocationObserver); | 2656 DISALLOW_COPY_AND_ASSIGN(InlineAllocationObserver); |
| 2848 }; | 2657 }; |
| 2849 | 2658 |
| 2850 } // namespace internal | 2659 } // namespace internal |
| 2851 } // namespace v8 | 2660 } // namespace v8 |
| 2852 | 2661 |
| 2853 #endif // V8_HEAP_HEAP_H_ | 2662 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |