56 // Note that rax and rdx are also used for return values. |
56 // Note that rax and rdx are also used for return values. |
57 // |
57 // |
58 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { |
58 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { |
59 const int i486_code_length = VtableStub::pd_code_size_limit(true); |
59 const int i486_code_length = VtableStub::pd_code_size_limit(true); |
60 VtableStub* s = new(i486_code_length) VtableStub(true, vtable_index); |
60 VtableStub* s = new(i486_code_length) VtableStub(true, vtable_index); |
|
61 // Can be NULL if there is no free space in the code cache. |
|
62 if (s == NULL) { |
|
63 return NULL; |
|
64 } |
|
65 |
61 ResourceMark rm; |
66 ResourceMark rm; |
62 CodeBuffer cb(s->entry_point(), i486_code_length); |
67 CodeBuffer cb(s->entry_point(), i486_code_length); |
63 MacroAssembler* masm = new MacroAssembler(&cb); |
68 MacroAssembler* masm = new MacroAssembler(&cb); |
64 |
69 |
65 #ifndef PRODUCT |
70 #ifndef PRODUCT |
130 VtableStub* VtableStubs::create_itable_stub(int itable_index) { |
135 VtableStub* VtableStubs::create_itable_stub(int itable_index) { |
131 // Note well: pd_code_size_limit is the absolute minimum we can get away with. If you |
136 // Note well: pd_code_size_limit is the absolute minimum we can get away with. If you |
132 // add code here, bump the code stub size returned by pd_code_size_limit! |
137 // add code here, bump the code stub size returned by pd_code_size_limit! |
133 const int i486_code_length = VtableStub::pd_code_size_limit(false); |
138 const int i486_code_length = VtableStub::pd_code_size_limit(false); |
134 VtableStub* s = new(i486_code_length) VtableStub(false, itable_index); |
139 VtableStub* s = new(i486_code_length) VtableStub(false, itable_index); |
|
140 // Can be NULL if there is no free space in the code cache. |
|
141 if (s == NULL) { |
|
142 return NULL; |
|
143 } |
|
144 |
135 ResourceMark rm; |
145 ResourceMark rm; |
136 CodeBuffer cb(s->entry_point(), i486_code_length); |
146 CodeBuffer cb(s->entry_point(), i486_code_length); |
137 MacroAssembler* masm = new MacroAssembler(&cb); |
147 MacroAssembler* masm = new MacroAssembler(&cb); |
138 |
148 |
139 // Entry arguments: |
149 // Entry arguments: |