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 3034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3045 set_js_construct_entry_code(*stub.GetCode(isolate())); | 3045 set_js_construct_entry_code(*stub.GetCode(isolate())); |
3046 } | 3046 } |
3047 | 3047 |
3048 | 3048 |
3049 void Heap::CreateFixedStubs() { | 3049 void Heap::CreateFixedStubs() { |
3050 // Here we create roots for fixed stubs. They are needed at GC | 3050 // Here we create roots for fixed stubs. They are needed at GC |
3051 // for cooking and uncooking (check out frames.cc). | 3051 // for cooking and uncooking (check out frames.cc). |
3052 // The eliminates the need for doing dictionary lookup in the | 3052 // The eliminates the need for doing dictionary lookup in the |
3053 // stub cache for these stubs. | 3053 // stub cache for these stubs. |
3054 HandleScope scope(isolate()); | 3054 HandleScope scope(isolate()); |
| 3055 |
| 3056 // Create stubs that should be there, so we don't unexpectedly have to |
| 3057 // create them if we need them during the creation of another stub. |
| 3058 // Stub creation mixes raw pointers and handles in an unsafe manner so |
| 3059 // we cannot create stubs while we are creating stubs. |
| 3060 CodeStub::GenerateStubsAheadOfTime(isolate()); |
| 3061 |
| 3062 // MacroAssembler::Abort calls (usually enabled with --debug-code) depend on |
| 3063 // CEntryStub, so we need to call GenerateStubsAheadOfTime before JSEntryStub |
| 3064 // is created. |
| 3065 |
3055 // gcc-4.4 has problem generating correct code of following snippet: | 3066 // gcc-4.4 has problem generating correct code of following snippet: |
3056 // { JSEntryStub stub; | 3067 // { JSEntryStub stub; |
3057 // js_entry_code_ = *stub.GetCode(); | 3068 // js_entry_code_ = *stub.GetCode(); |
3058 // } | 3069 // } |
3059 // { JSConstructEntryStub stub; | 3070 // { JSConstructEntryStub stub; |
3060 // js_construct_entry_code_ = *stub.GetCode(); | 3071 // js_construct_entry_code_ = *stub.GetCode(); |
3061 // } | 3072 // } |
3062 // To workaround the problem, make separate functions without inlining. | 3073 // To workaround the problem, make separate functions without inlining. |
3063 Heap::CreateJSEntryStub(); | 3074 Heap::CreateJSEntryStub(); |
3064 Heap::CreateJSConstructEntryStub(); | 3075 Heap::CreateJSConstructEntryStub(); |
3065 | |
3066 // Create stubs that should be there, so we don't unexpectedly have to | |
3067 // create them if we need them during the creation of another stub. | |
3068 // Stub creation mixes raw pointers and handles in an unsafe manner so | |
3069 // we cannot create stubs while we are creating stubs. | |
3070 CodeStub::GenerateStubsAheadOfTime(isolate()); | |
3071 } | 3076 } |
3072 | 3077 |
3073 | 3078 |
3074 bool Heap::CreateInitialObjects() { | 3079 bool Heap::CreateInitialObjects() { |
3075 Object* obj; | 3080 Object* obj; |
3076 | 3081 |
3077 // The -0 value must be set before NumberFromDouble works. | 3082 // The -0 value must be set before NumberFromDouble works. |
3078 { MaybeObject* maybe_obj = AllocateHeapNumber(-0.0, TENURED); | 3083 { MaybeObject* maybe_obj = AllocateHeapNumber(-0.0, TENURED); |
3079 if (!maybe_obj->ToObject(&obj)) return false; | 3084 if (!maybe_obj->ToObject(&obj)) return false; |
3080 } | 3085 } |
(...skipping 4625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7706 static_cast<int>(object_sizes_last_time_[index])); | 7711 static_cast<int>(object_sizes_last_time_[index])); |
7707 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7712 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
7708 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7713 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7709 | 7714 |
7710 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7715 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7711 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7716 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7712 ClearObjectStats(); | 7717 ClearObjectStats(); |
7713 } | 7718 } |
7714 | 7719 |
7715 } } // namespace v8::internal | 7720 } } // namespace v8::internal |
OLD | NEW |