| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/field-index.h" | 8 #include "src/field-index.h" |
| 9 #include "src/hydrogen.h" | 9 #include "src/hydrogen.h" |
| 10 #include "src/lithium.h" | 10 #include "src/lithium.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 GetStubType()); | 244 GetStubType()); |
| 245 Handle<Code> new_object = factory->NewCode( | 245 Handle<Code> new_object = factory->NewCode( |
| 246 desc, flags, masm.CodeObject(), NeedsImmovableCode()); | 246 desc, flags, masm.CodeObject(), NeedsImmovableCode()); |
| 247 return new_object; | 247 return new_object; |
| 248 } | 248 } |
| 249 | 249 |
| 250 | 250 |
| 251 template <class Stub> | 251 template <class Stub> |
| 252 static Handle<Code> DoGenerateCode(Stub* stub) { | 252 static Handle<Code> DoGenerateCode(Stub* stub) { |
| 253 Isolate* isolate = stub->isolate(); | 253 Isolate* isolate = stub->isolate(); |
| 254 CodeStub::Major major_key = | 254 CodeStub::Major major_key = static_cast<CodeStub*>(stub)->MajorKey(); |
| 255 static_cast<HydrogenCodeStub*>(stub)->MajorKey(); | |
| 256 CodeStubInterfaceDescriptor* descriptor = | 255 CodeStubInterfaceDescriptor* descriptor = |
| 257 isolate->code_stub_interface_descriptor(major_key); | 256 isolate->code_stub_interface_descriptor(major_key); |
| 258 if (!descriptor->IsInitialized()) { | 257 if (!descriptor->IsInitialized()) { |
| 259 stub->InitializeInterfaceDescriptor(descriptor); | 258 stub->InitializeInterfaceDescriptor(descriptor); |
| 260 } | 259 } |
| 261 | 260 |
| 262 // If we are uninitialized we can use a light-weight stub to enter | 261 // If we are uninitialized we can use a light-weight stub to enter |
| 263 // the runtime that is significantly faster than using the standard | 262 // the runtime that is significantly faster than using the standard |
| 264 // stub-failure deopt mechanism. | 263 // stub-failure deopt mechanism. |
| 265 if (stub->IsUninitialized() && descriptor->has_miss_handler()) { | 264 if (stub->IsUninitialized() && descriptor->has_miss_handler()) { |
| (...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 return Pop(); | 1788 return Pop(); |
| 1790 } | 1789 } |
| 1791 | 1790 |
| 1792 | 1791 |
| 1793 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 1792 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
| 1794 return DoGenerateCode(this); | 1793 return DoGenerateCode(this); |
| 1795 } | 1794 } |
| 1796 | 1795 |
| 1797 | 1796 |
| 1798 } } // namespace v8::internal | 1797 } } // namespace v8::internal |
| OLD | NEW |