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 3044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3055 Heap::CreateJSConstructEntryStub(); | 3055 Heap::CreateJSConstructEntryStub(); |
3056 | 3056 |
3057 // Create stubs that should be there, so we don't unexpectedly have to | 3057 // Create stubs that should be there, so we don't unexpectedly have to |
3058 // create them if we need them during the creation of another stub. | 3058 // create them if we need them during the creation of another stub. |
3059 // Stub creation mixes raw pointers and handles in an unsafe manner so | 3059 // Stub creation mixes raw pointers and handles in an unsafe manner so |
3060 // we cannot create stubs while we are creating stubs. | 3060 // we cannot create stubs while we are creating stubs. |
3061 CodeStub::GenerateStubsAheadOfTime(isolate()); | 3061 CodeStub::GenerateStubsAheadOfTime(isolate()); |
3062 } | 3062 } |
3063 | 3063 |
3064 | 3064 |
3065 void Heap::CreateStubsRequiringBuiltins() { | |
3066 HandleScope scope(isolate()); | |
3067 CodeStub::GenerateStubsRequiringBuiltinsAheadOfTime(isolate()); | |
3068 } | |
3069 | |
3070 | |
3071 bool Heap::CreateInitialObjects() { | 3065 bool Heap::CreateInitialObjects() { |
3072 Object* obj; | 3066 Object* obj; |
3073 | 3067 |
3074 // The -0 value must be set before NumberFromDouble works. | 3068 // The -0 value must be set before NumberFromDouble works. |
3075 { MaybeObject* maybe_obj = AllocateHeapNumber(-0.0, TENURED); | 3069 { MaybeObject* maybe_obj = AllocateHeapNumber(-0.0, TENURED); |
3076 if (!maybe_obj->ToObject(&obj)) return false; | 3070 if (!maybe_obj->ToObject(&obj)) return false; |
3077 } | 3071 } |
3078 set_minus_zero_value(HeapNumber::cast(obj)); | 3072 set_minus_zero_value(HeapNumber::cast(obj)); |
3079 ASSERT(std::signbit(minus_zero_value()->Number()) != 0); | 3073 ASSERT(std::signbit(minus_zero_value()->Number()) != 0); |
3080 | 3074 |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3971 // Initialize the object | 3965 // Initialize the object |
3972 result->set_map_no_write_barrier(code_map()); | 3966 result->set_map_no_write_barrier(code_map()); |
3973 Code* code = Code::cast(result); | 3967 Code* code = Code::cast(result); |
3974 ASSERT(!isolate_->code_range()->exists() || | 3968 ASSERT(!isolate_->code_range()->exists() || |
3975 isolate_->code_range()->contains(code->address())); | 3969 isolate_->code_range()->contains(code->address())); |
3976 code->set_instruction_size(desc.instr_size); | 3970 code->set_instruction_size(desc.instr_size); |
3977 code->set_relocation_info(reloc_info); | 3971 code->set_relocation_info(reloc_info); |
3978 code->set_flags(flags); | 3972 code->set_flags(flags); |
3979 code->set_raw_kind_specific_flags1(0); | 3973 code->set_raw_kind_specific_flags1(0); |
3980 code->set_raw_kind_specific_flags2(0); | 3974 code->set_raw_kind_specific_flags2(0); |
3981 if (code->is_call_stub() || code->is_keyed_call_stub()) { | |
3982 code->set_check_type(RECEIVER_MAP_CHECK); | |
3983 } | |
3984 code->set_is_crankshafted(crankshafted); | 3975 code->set_is_crankshafted(crankshafted); |
3985 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER); | 3976 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER); |
3986 code->set_raw_type_feedback_info(undefined_value()); | 3977 code->set_raw_type_feedback_info(undefined_value()); |
3987 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); | 3978 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); |
3988 code->set_gc_metadata(Smi::FromInt(0)); | 3979 code->set_gc_metadata(Smi::FromInt(0)); |
3989 code->set_ic_age(global_ic_age_); | 3980 code->set_ic_age(global_ic_age_); |
3990 code->set_prologue_offset(prologue_offset); | 3981 code->set_prologue_offset(prologue_offset); |
3991 if (code->kind() == Code::OPTIMIZED_FUNCTION) { | 3982 if (code->kind() == Code::OPTIMIZED_FUNCTION) { |
3992 code->set_marked_for_deoptimization(false); | 3983 code->set_marked_for_deoptimization(false); |
3993 } | 3984 } |
(...skipping 3669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7663 static_cast<int>(object_sizes_last_time_[index])); | 7654 static_cast<int>(object_sizes_last_time_[index])); |
7664 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7655 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
7665 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7656 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7666 | 7657 |
7667 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7658 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7668 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7659 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7669 ClearObjectStats(); | 7660 ClearObjectStats(); |
7670 } | 7661 } |
7671 | 7662 |
7672 } } // namespace v8::internal | 7663 } } // namespace v8::internal |
OLD | NEW |