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 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1931 if (!maybe_result->ToObject(&result)) return maybe_result; | 1931 if (!maybe_result->ToObject(&result)) return maybe_result; |
1932 } | 1932 } |
1933 AccessorPair* accessors = AccessorPair::cast(result); | 1933 AccessorPair* accessors = AccessorPair::cast(result); |
1934 // Later we will have to distinguish between undefined and the hole... | 1934 // Later we will have to distinguish between undefined and the hole... |
1935 // accessors->set_getter(the_hole_value(), SKIP_WRITE_BARRIER); | 1935 // accessors->set_getter(the_hole_value(), SKIP_WRITE_BARRIER); |
1936 // accessors->set_setter(the_hole_value(), SKIP_WRITE_BARRIER); | 1936 // accessors->set_setter(the_hole_value(), SKIP_WRITE_BARRIER); |
1937 return accessors; | 1937 return accessors; |
1938 } | 1938 } |
1939 | 1939 |
1940 | 1940 |
| 1941 MaybeObject* Heap::AllocateTypeFeedbackInfo() { |
| 1942 TypeFeedbackInfo* info; |
| 1943 { MaybeObject* maybe_result = AllocateStruct(TYPE_FEEDBACK_INFO_TYPE); |
| 1944 if (!maybe_result->To(&info)) return maybe_result; |
| 1945 } |
| 1946 info->set_ic_total_count(0); |
| 1947 info->set_ic_with_typeinfo_count(0); |
| 1948 info->set_type_feedback_cells(TypeFeedbackCells::cast(empty_fixed_array()), |
| 1949 SKIP_WRITE_BARRIER); |
| 1950 return info; |
| 1951 } |
| 1952 |
| 1953 |
1941 const Heap::StringTypeTable Heap::string_type_table[] = { | 1954 const Heap::StringTypeTable Heap::string_type_table[] = { |
1942 #define STRING_TYPE_ELEMENT(type, size, name, camel_name) \ | 1955 #define STRING_TYPE_ELEMENT(type, size, name, camel_name) \ |
1943 {type, size, k##camel_name##MapRootIndex}, | 1956 {type, size, k##camel_name##MapRootIndex}, |
1944 STRING_TYPE_LIST(STRING_TYPE_ELEMENT) | 1957 STRING_TYPE_LIST(STRING_TYPE_ELEMENT) |
1945 #undef STRING_TYPE_ELEMENT | 1958 #undef STRING_TYPE_ELEMENT |
1946 }; | 1959 }; |
1947 | 1960 |
1948 | 1961 |
1949 const Heap::ConstantSymbolTable Heap::constant_symbol_table[] = { | 1962 const Heap::ConstantSymbolTable Heap::constant_symbol_table[] = { |
1950 #define CONSTANT_SYMBOL_ELEMENT(name, contents) \ | 1963 #define CONSTANT_SYMBOL_ELEMENT(name, contents) \ |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3354 Code* code = Code::cast(result); | 3367 Code* code = Code::cast(result); |
3355 ASSERT(!isolate_->code_range()->exists() || | 3368 ASSERT(!isolate_->code_range()->exists() || |
3356 isolate_->code_range()->contains(code->address())); | 3369 isolate_->code_range()->contains(code->address())); |
3357 code->set_instruction_size(desc.instr_size); | 3370 code->set_instruction_size(desc.instr_size); |
3358 code->set_relocation_info(reloc_info); | 3371 code->set_relocation_info(reloc_info); |
3359 code->set_flags(flags); | 3372 code->set_flags(flags); |
3360 if (code->is_call_stub() || code->is_keyed_call_stub()) { | 3373 if (code->is_call_stub() || code->is_keyed_call_stub()) { |
3361 code->set_check_type(RECEIVER_MAP_CHECK); | 3374 code->set_check_type(RECEIVER_MAP_CHECK); |
3362 } | 3375 } |
3363 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER); | 3376 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER); |
3364 code->set_type_feedback_cells(TypeFeedbackCells::cast(empty_fixed_array()), | 3377 code->set_type_feedback_info(undefined_value(), SKIP_WRITE_BARRIER); |
3365 SKIP_WRITE_BARRIER); | |
3366 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); | 3378 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); |
3367 code->set_gc_metadata(Smi::FromInt(0)); | 3379 code->set_gc_metadata(Smi::FromInt(0)); |
3368 // Allow self references to created code object by patching the handle to | 3380 // Allow self references to created code object by patching the handle to |
3369 // point to the newly allocated Code object. | 3381 // point to the newly allocated Code object. |
3370 if (!self_reference.is_null()) { | 3382 if (!self_reference.is_null()) { |
3371 *(self_reference.location()) = code; | 3383 *(self_reference.location()) = code; |
3372 } | 3384 } |
3373 // Migrate generated code. | 3385 // Migrate generated code. |
3374 // The generated code can contain Object** values (typically from handles) | 3386 // The generated code can contain Object** values (typically from handles) |
3375 // that are dereferenced during the copy to point directly to the actual heap | 3387 // that are dereferenced during the copy to point directly to the actual heap |
(...skipping 3505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6881 isolate_->heap()->store_buffer()->Compact(); | 6893 isolate_->heap()->store_buffer()->Compact(); |
6882 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6894 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6883 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6895 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6884 next = chunk->next_chunk(); | 6896 next = chunk->next_chunk(); |
6885 isolate_->memory_allocator()->Free(chunk); | 6897 isolate_->memory_allocator()->Free(chunk); |
6886 } | 6898 } |
6887 chunks_queued_for_free_ = NULL; | 6899 chunks_queued_for_free_ = NULL; |
6888 } | 6900 } |
6889 | 6901 |
6890 } } // namespace v8::internal | 6902 } } // namespace v8::internal |
OLD | NEW |