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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 return new_object; | 128 return new_object; |
129 } | 129 } |
130 | 130 |
131 | 131 |
132 void CodeStub::VerifyPlatformFeatures(Isolate* isolate) { | 132 void CodeStub::VerifyPlatformFeatures(Isolate* isolate) { |
133 ASSERT(CpuFeatures::VerifyCrossCompiling()); | 133 ASSERT(CpuFeatures::VerifyCrossCompiling()); |
134 } | 134 } |
135 | 135 |
136 | 136 |
137 Handle<Code> CodeStub::GetCode(Isolate* isolate) { | 137 Handle<Code> CodeStub::GetCode(Isolate* isolate) { |
| 138 Factory* factory = isolate->factory(); |
138 Heap* heap = isolate->heap(); | 139 Heap* heap = isolate->heap(); |
139 Code* code; | 140 Code* code; |
140 if (UseSpecialCache() | 141 if (UseSpecialCache() |
141 ? FindCodeInSpecialCache(&code, isolate) | 142 ? FindCodeInSpecialCache(&code, isolate) |
142 : FindCodeInCache(&code, isolate)) { | 143 : FindCodeInCache(&code, isolate)) { |
143 ASSERT(GetCodeKind() == code->kind()); | 144 ASSERT(GetCodeKind() == code->kind()); |
144 return Handle<Code>(code); | 145 return Handle<Code>(code); |
145 } | 146 } |
146 | 147 |
147 #ifdef DEBUG | 148 #ifdef DEBUG |
(...skipping 14 matching lines...) Expand all Loading... |
162 new_object->Disassemble(GetName().get(), trace_scope.file()); | 163 new_object->Disassemble(GetName().get(), trace_scope.file()); |
163 PrintF(trace_scope.file(), "\n"); | 164 PrintF(trace_scope.file(), "\n"); |
164 } | 165 } |
165 #endif | 166 #endif |
166 | 167 |
167 if (UseSpecialCache()) { | 168 if (UseSpecialCache()) { |
168 AddToSpecialCache(new_object); | 169 AddToSpecialCache(new_object); |
169 } else { | 170 } else { |
170 // Update the dictionary and the root in Heap. | 171 // Update the dictionary and the root in Heap. |
171 Handle<UnseededNumberDictionary> dict = | 172 Handle<UnseededNumberDictionary> dict = |
172 UnseededNumberDictionary::AtNumberPut( | 173 factory->DictionaryAtNumberPut( |
173 Handle<UnseededNumberDictionary>(heap->code_stubs()), | 174 Handle<UnseededNumberDictionary>(heap->code_stubs()), |
174 GetKey(), | 175 GetKey(), |
175 new_object); | 176 new_object); |
176 heap->public_set_code_stubs(*dict); | 177 heap->public_set_code_stubs(*dict); |
177 } | 178 } |
178 code = *new_object; | 179 code = *new_object; |
179 } | 180 } |
180 | 181 |
181 Activate(code); | 182 Activate(code); |
182 ASSERT(!NeedsImmovableCode() || | 183 ASSERT(!NeedsImmovableCode() || |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 InstallDescriptor(isolate, &stub3); | 820 InstallDescriptor(isolate, &stub3); |
820 } | 821 } |
821 | 822 |
822 InternalArrayConstructorStub::InternalArrayConstructorStub( | 823 InternalArrayConstructorStub::InternalArrayConstructorStub( |
823 Isolate* isolate) : PlatformCodeStub(isolate) { | 824 Isolate* isolate) : PlatformCodeStub(isolate) { |
824 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 825 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
825 } | 826 } |
826 | 827 |
827 | 828 |
828 } } // namespace v8::internal | 829 } } // namespace v8::internal |
OLD | NEW |