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 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 V(CreateAllocationSite) \ | 62 V(CreateAllocationSite) \ |
63 V(ElementsTransitionAndStore) \ | 63 V(ElementsTransitionAndStore) \ |
64 V(FastCloneShallowArray) \ | 64 V(FastCloneShallowArray) \ |
65 V(FastCloneShallowObject) \ | 65 V(FastCloneShallowObject) \ |
66 V(FastNewClosure) \ | 66 V(FastNewClosure) \ |
67 V(FastNewContext) \ | 67 V(FastNewContext) \ |
68 V(InternalArrayNArgumentsConstructor) \ | 68 V(InternalArrayNArgumentsConstructor) \ |
69 V(InternalArrayNoArgumentConstructor) \ | 69 V(InternalArrayNoArgumentConstructor) \ |
70 V(InternalArraySingleArgumentConstructor) \ | 70 V(InternalArraySingleArgumentConstructor) \ |
71 V(KeyedLoadGeneric) \ | 71 V(KeyedLoadGeneric) \ |
| 72 V(LoadGlobalContextField) \ |
72 V(LoadDictionaryElement) \ | 73 V(LoadDictionaryElement) \ |
73 V(LoadFastElement) \ | 74 V(LoadFastElement) \ |
74 V(MegamorphicLoad) \ | 75 V(MegamorphicLoad) \ |
75 V(NameDictionaryLookup) \ | 76 V(NameDictionaryLookup) \ |
76 V(NumberToString) \ | 77 V(NumberToString) \ |
77 V(RegExpConstructResult) \ | 78 V(RegExpConstructResult) \ |
78 V(StoreFastElement) \ | 79 V(StoreFastElement) \ |
79 V(StringAdd) \ | 80 V(StringAdd) \ |
80 V(ToBoolean) \ | 81 V(ToBoolean) \ |
81 V(TransitionElementsKind) \ | 82 V(TransitionElementsKind) \ |
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2009 class SkipFastPathBits: | 2010 class SkipFastPathBits: |
2010 public BitField<int, 2 * kBitsPerRegisterNumber + 4, 1> {}; // NOLINT | 2011 public BitField<int, 2 * kBitsPerRegisterNumber + 4, 1> {}; // NOLINT |
2011 class SSE3Bits: | 2012 class SSE3Bits: |
2012 public BitField<int, 2 * kBitsPerRegisterNumber + 5, 1> {}; // NOLINT | 2013 public BitField<int, 2 * kBitsPerRegisterNumber + 5, 1> {}; // NOLINT |
2013 | 2014 |
2014 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 2015 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
2015 DEFINE_PLATFORM_CODE_STUB(DoubleToI, PlatformCodeStub); | 2016 DEFINE_PLATFORM_CODE_STUB(DoubleToI, PlatformCodeStub); |
2016 }; | 2017 }; |
2017 | 2018 |
2018 | 2019 |
| 2020 class LoadGlobalContextFieldStub : public HandlerStub { |
| 2021 public: |
| 2022 LoadGlobalContextFieldStub( |
| 2023 Isolate* isolate, const GlobalContextTable::LookupResult* lookup_result) |
| 2024 : HandlerStub(isolate) { |
| 2025 DCHECK(Accepted(lookup_result)); |
| 2026 set_sub_minor_key(ContextIndexBits::encode(lookup_result->context_index) | |
| 2027 SlotIndexBits::encode(lookup_result->slot_index)); |
| 2028 } |
| 2029 |
| 2030 int context_index() const { |
| 2031 return ContextIndexBits::decode(sub_minor_key()); |
| 2032 } |
| 2033 |
| 2034 int slot_index() const { return SlotIndexBits::decode(sub_minor_key()); } |
| 2035 |
| 2036 static bool Accepted(const GlobalContextTable::LookupResult* lookup_result) { |
| 2037 return ContextIndexBits::is_valid(lookup_result->context_index) && |
| 2038 SlotIndexBits::is_valid(lookup_result->slot_index); |
| 2039 } |
| 2040 |
| 2041 private: |
| 2042 static const int kContextIndexBits = 13; |
| 2043 static const int kSlotIndexBits = 13; |
| 2044 class ContextIndexBits : public BitField<int, 0, kContextIndexBits> {}; |
| 2045 class SlotIndexBits |
| 2046 : public BitField<int, kContextIndexBits, kSlotIndexBits> {}; |
| 2047 |
| 2048 virtual Code::Kind kind() const { return Code::LOAD_IC; } |
| 2049 virtual Code::StubType GetStubType() OVERRIDE { return Code::FAST; } |
| 2050 |
| 2051 |
| 2052 virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE { |
| 2053 return ContextOnlyDescriptor(isolate()); |
| 2054 } |
| 2055 |
| 2056 DEFINE_HANDLER_CODE_STUB(LoadGlobalContextField, HandlerStub); |
| 2057 }; |
| 2058 |
| 2059 |
2019 class LoadFastElementStub : public HydrogenCodeStub { | 2060 class LoadFastElementStub : public HydrogenCodeStub { |
2020 public: | 2061 public: |
2021 LoadFastElementStub(Isolate* isolate, bool is_js_array, | 2062 LoadFastElementStub(Isolate* isolate, bool is_js_array, |
2022 ElementsKind elements_kind) | 2063 ElementsKind elements_kind) |
2023 : HydrogenCodeStub(isolate) { | 2064 : HydrogenCodeStub(isolate) { |
2024 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | | 2065 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | |
2025 IsJSArrayBits::encode(is_js_array)); | 2066 IsJSArrayBits::encode(is_js_array)); |
2026 } | 2067 } |
2027 | 2068 |
2028 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | 2069 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 | 2589 |
2549 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2590 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
2550 #undef DEFINE_PLATFORM_CODE_STUB | 2591 #undef DEFINE_PLATFORM_CODE_STUB |
2551 #undef DEFINE_HANDLER_CODE_STUB | 2592 #undef DEFINE_HANDLER_CODE_STUB |
2552 #undef DEFINE_HYDROGEN_CODE_STUB | 2593 #undef DEFINE_HYDROGEN_CODE_STUB |
2553 #undef DEFINE_CODE_STUB | 2594 #undef DEFINE_CODE_STUB |
2554 #undef DEFINE_CODE_STUB_BASE | 2595 #undef DEFINE_CODE_STUB_BASE |
2555 } } // namespace v8::internal | 2596 } } // namespace v8::internal |
2556 | 2597 |
2557 #endif // V8_CODE_STUBS_H_ | 2598 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |