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 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2817 native_context_map->set_dictionary_map(true); | 2817 native_context_map->set_dictionary_map(true); |
2818 native_context_map->set_visitor_id(StaticVisitorBase::kVisitNativeContext); | 2818 native_context_map->set_visitor_id(StaticVisitorBase::kVisitNativeContext); |
2819 set_native_context_map(native_context_map); | 2819 set_native_context_map(native_context_map); |
2820 | 2820 |
2821 { MaybeObject* maybe_obj = AllocateMap(SHARED_FUNCTION_INFO_TYPE, | 2821 { MaybeObject* maybe_obj = AllocateMap(SHARED_FUNCTION_INFO_TYPE, |
2822 SharedFunctionInfo::kAlignedSize); | 2822 SharedFunctionInfo::kAlignedSize); |
2823 if (!maybe_obj->ToObject(&obj)) return false; | 2823 if (!maybe_obj->ToObject(&obj)) return false; |
2824 } | 2824 } |
2825 set_shared_function_info_map(Map::cast(obj)); | 2825 set_shared_function_info_map(Map::cast(obj)); |
2826 | 2826 |
2827 { MaybeObject* maybe_obj = AllocateMap(OPTIMIZED_CODE_ENTRY_TYPE, | |
2828 OptimizedCodeEntry::kAlignedSize); | |
2829 if (!maybe_obj->ToObject(&obj)) return false; | |
2830 } | |
2831 set_optimized_code_entry_map(Map::cast(obj)); | |
2832 | |
2827 { MaybeObject* maybe_obj = AllocateMap(JS_MESSAGE_OBJECT_TYPE, | 2833 { MaybeObject* maybe_obj = AllocateMap(JS_MESSAGE_OBJECT_TYPE, |
2828 JSMessageObject::kSize); | 2834 JSMessageObject::kSize); |
2829 if (!maybe_obj->ToObject(&obj)) return false; | 2835 if (!maybe_obj->ToObject(&obj)) return false; |
2830 } | 2836 } |
2831 set_message_object_map(Map::cast(obj)); | 2837 set_message_object_map(Map::cast(obj)); |
2832 | 2838 |
2833 Map* external_map; | 2839 Map* external_map; |
2834 { MaybeObject* maybe_obj = | 2840 { MaybeObject* maybe_obj = |
2835 AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize + kPointerSize); | 2841 AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize + kPointerSize); |
2836 if (!maybe_obj->To(&external_map)) return false; | 2842 if (!maybe_obj->To(&external_map)) return false; |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3644 share->set_end_position(0); | 3650 share->set_end_position(0); |
3645 share->set_function_token_position(0); | 3651 share->set_function_token_position(0); |
3646 // All compiler hints default to false or 0. | 3652 // All compiler hints default to false or 0. |
3647 share->set_compiler_hints(0); | 3653 share->set_compiler_hints(0); |
3648 share->set_opt_count(0); | 3654 share->set_opt_count(0); |
3649 | 3655 |
3650 return share; | 3656 return share; |
3651 } | 3657 } |
3652 | 3658 |
3653 | 3659 |
3660 MaybeObject* Heap::AllocateOptimizedCodeEntry( | |
3661 Context* native_context, | |
3662 JSFunction* function, | |
3663 Code* code, | |
3664 FixedArray* literals) { | |
3665 OptimizedCodeEntry* entry; | |
3666 MaybeObject* maybe = Allocate(optimized_code_entry_map(), OLD_POINTER_SPACE); | |
3667 if (!maybe->To<OptimizedCodeEntry>(&entry)) return maybe; | |
3668 | |
3669 // Set pointer fields. | |
3670 entry->set_native_context(native_context, SKIP_WRITE_BARRIER); | |
Michael Starzinger
2013/08/28 14:59:47
Skipping WBs for all four of these setters is not
| |
3671 entry->set_function(function, SKIP_WRITE_BARRIER); | |
3672 entry->set_code(code, SKIP_WRITE_BARRIER); | |
3673 entry->set_literals(literals, SKIP_WRITE_BARRIER); | |
3674 | |
3675 // NULL-out link fields. | |
3676 entry->set_next_by_shared_info(NULL, SKIP_WRITE_BARRIER); | |
3677 entry->set_next_by_native_context(NULL, SKIP_WRITE_BARRIER); | |
3678 entry->set_cacheable(false); | |
3679 | |
3680 return entry; | |
3681 } | |
3682 | |
3683 | |
3654 MaybeObject* Heap::AllocateJSMessageObject(String* type, | 3684 MaybeObject* Heap::AllocateJSMessageObject(String* type, |
3655 JSArray* arguments, | 3685 JSArray* arguments, |
3656 int start_position, | 3686 int start_position, |
3657 int end_position, | 3687 int end_position, |
3658 Object* script, | 3688 Object* script, |
3659 Object* stack_trace, | 3689 Object* stack_trace, |
3660 Object* stack_frames) { | 3690 Object* stack_frames) { |
3661 Object* result; | 3691 Object* result; |
3662 { MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE); | 3692 { MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE); |
3663 if (!maybe_result->ToObject(&result)) return maybe_result; | 3693 if (!maybe_result->ToObject(&result)) return maybe_result; |
(...skipping 4387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8051 if (FLAG_concurrent_recompilation) { | 8081 if (FLAG_concurrent_recompilation) { |
8052 heap_->relocation_mutex_->Lock(); | 8082 heap_->relocation_mutex_->Lock(); |
8053 #ifdef DEBUG | 8083 #ifdef DEBUG |
8054 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8084 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
8055 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8085 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
8056 #endif // DEBUG | 8086 #endif // DEBUG |
8057 } | 8087 } |
8058 } | 8088 } |
8059 | 8089 |
8060 } } // namespace v8::internal | 8090 } } // namespace v8::internal |
OLD | NEW |