Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/heap.cc

Issue 12317141: Added Isolate parameter to CodeStub::GetCode(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed whitespace. Rebased. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.cc ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2682 FixedArray::cast(elements)->set(0, Smi::FromInt(0)); 2682 FixedArray::cast(elements)->set(0, Smi::FromInt(0));
2683 JSObject::cast(obj)->set_elements(FixedArray::cast(elements)); 2683 JSObject::cast(obj)->set_elements(FixedArray::cast(elements));
2684 set_message_listeners(JSObject::cast(obj)); 2684 set_message_listeners(JSObject::cast(obj));
2685 2685
2686 return true; 2686 return true;
2687 } 2687 }
2688 2688
2689 2689
2690 void Heap::CreateJSEntryStub() { 2690 void Heap::CreateJSEntryStub() {
2691 JSEntryStub stub; 2691 JSEntryStub stub;
2692 set_js_entry_code(*stub.GetCode()); 2692 set_js_entry_code(*stub.GetCode(isolate()));
2693 } 2693 }
2694 2694
2695 2695
2696 void Heap::CreateJSConstructEntryStub() { 2696 void Heap::CreateJSConstructEntryStub() {
2697 JSConstructEntryStub stub; 2697 JSConstructEntryStub stub;
2698 set_js_construct_entry_code(*stub.GetCode()); 2698 set_js_construct_entry_code(*stub.GetCode(isolate()));
2699 } 2699 }
2700 2700
2701 2701
2702 void Heap::CreateFixedStubs() { 2702 void Heap::CreateFixedStubs() {
2703 // Here we create roots for fixed stubs. They are needed at GC 2703 // Here we create roots for fixed stubs. They are needed at GC
2704 // for cooking and uncooking (check out frames.cc). 2704 // for cooking and uncooking (check out frames.cc).
2705 // The eliminates the need for doing dictionary lookup in the 2705 // The eliminates the need for doing dictionary lookup in the
2706 // stub cache for these stubs. 2706 // stub cache for these stubs.
2707 HandleScope scope(isolate()); 2707 HandleScope scope(isolate());
2708 // gcc-4.4 has problem generating correct code of following snippet: 2708 // gcc-4.4 has problem generating correct code of following snippet:
2709 // { JSEntryStub stub; 2709 // { JSEntryStub stub;
2710 // js_entry_code_ = *stub.GetCode(); 2710 // js_entry_code_ = *stub.GetCode();
2711 // } 2711 // }
2712 // { JSConstructEntryStub stub; 2712 // { JSConstructEntryStub stub;
2713 // js_construct_entry_code_ = *stub.GetCode(); 2713 // js_construct_entry_code_ = *stub.GetCode();
2714 // } 2714 // }
2715 // To workaround the problem, make separate functions without inlining. 2715 // To workaround the problem, make separate functions without inlining.
2716 Heap::CreateJSEntryStub(); 2716 Heap::CreateJSEntryStub();
2717 Heap::CreateJSConstructEntryStub(); 2717 Heap::CreateJSConstructEntryStub();
2718 2718
2719 // Create stubs that should be there, so we don't unexpectedly have to 2719 // Create stubs that should be there, so we don't unexpectedly have to
2720 // create them if we need them during the creation of another stub. 2720 // create them if we need them during the creation of another stub.
2721 // Stub creation mixes raw pointers and handles in an unsafe manner so 2721 // Stub creation mixes raw pointers and handles in an unsafe manner so
2722 // we cannot create stubs while we are creating stubs. 2722 // we cannot create stubs while we are creating stubs.
2723 CodeStub::GenerateStubsAheadOfTime(); 2723 CodeStub::GenerateStubsAheadOfTime(isolate());
2724 } 2724 }
2725 2725
2726 2726
2727 bool Heap::CreateInitialObjects() { 2727 bool Heap::CreateInitialObjects() {
2728 Object* obj; 2728 Object* obj;
2729 2729
2730 // The -0 value must be set before NumberFromDouble works. 2730 // The -0 value must be set before NumberFromDouble works.
2731 { MaybeObject* maybe_obj = AllocateHeapNumber(-0.0, TENURED); 2731 { MaybeObject* maybe_obj = AllocateHeapNumber(-0.0, TENURED);
2732 if (!maybe_obj->ToObject(&obj)) return false; 2732 if (!maybe_obj->ToObject(&obj)) return false;
2733 } 2733 }
(...skipping 4802 matching lines...) Expand 10 before | Expand all | Expand 10 after
7536 static_cast<int>(object_sizes_last_time_[index])); 7536 static_cast<int>(object_sizes_last_time_[index]));
7537 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7537 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7538 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7538 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7539 7539
7540 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7540 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7541 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7541 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7542 ClearObjectStats(); 7542 ClearObjectStats();
7543 } 7543 }
7544 7544
7545 } } // namespace v8::internal 7545 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698