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 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2221 private: | 2221 private: |
2222 Code::Kind kind() const override { return Code::STORE_IC; } | 2222 Code::Kind kind() const override { return Code::STORE_IC; } |
2223 | 2223 |
2224 DEFINE_HANDLER_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); | 2224 DEFINE_HANDLER_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); |
2225 }; | 2225 }; |
2226 | 2226 |
2227 | 2227 |
2228 class LoadFastElementStub : public HydrogenCodeStub { | 2228 class LoadFastElementStub : public HydrogenCodeStub { |
2229 public: | 2229 public: |
2230 LoadFastElementStub(Isolate* isolate, bool is_js_array, | 2230 LoadFastElementStub(Isolate* isolate, bool is_js_array, |
2231 ElementsKind elements_kind) | 2231 ElementsKind elements_kind, |
| 2232 bool convert_hole_to_undefined = false) |
2232 : HydrogenCodeStub(isolate) { | 2233 : HydrogenCodeStub(isolate) { |
2233 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | | 2234 set_sub_minor_key( |
2234 IsJSArrayBits::encode(is_js_array)); | 2235 ElementsKindBits::encode(elements_kind) | |
| 2236 IsJSArrayBits::encode(is_js_array) | |
| 2237 CanConvertHoleToUndefined::encode(convert_hole_to_undefined)); |
2235 } | 2238 } |
2236 | 2239 |
2237 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } | 2240 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
| 2241 bool convert_hole_to_undefined() const { |
| 2242 return CanConvertHoleToUndefined::decode(sub_minor_key()); |
| 2243 } |
2238 | 2244 |
2239 ElementsKind elements_kind() const { | 2245 ElementsKind elements_kind() const { |
2240 return ElementsKindBits::decode(sub_minor_key()); | 2246 return ElementsKindBits::decode(sub_minor_key()); |
2241 } | 2247 } |
2242 | 2248 |
2243 private: | 2249 private: |
2244 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 2250 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
2245 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 2251 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
| 2252 class CanConvertHoleToUndefined : public BitField<bool, 9, 1> {}; |
2246 | 2253 |
2247 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { | 2254 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { |
2248 if (FLAG_vector_ics) { | 2255 if (FLAG_vector_ics) { |
2249 return VectorLoadICDescriptor(isolate()); | 2256 return VectorLoadICDescriptor(isolate()); |
2250 } | 2257 } |
2251 return LoadDescriptor(isolate()); | 2258 return LoadDescriptor(isolate()); |
2252 } | 2259 } |
2253 | 2260 |
2254 DEFINE_HYDROGEN_CODE_STUB(LoadFastElement, HydrogenCodeStub); | 2261 DEFINE_HYDROGEN_CODE_STUB(LoadFastElement, HydrogenCodeStub); |
2255 }; | 2262 }; |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2755 | 2762 |
2756 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2763 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
2757 #undef DEFINE_PLATFORM_CODE_STUB | 2764 #undef DEFINE_PLATFORM_CODE_STUB |
2758 #undef DEFINE_HANDLER_CODE_STUB | 2765 #undef DEFINE_HANDLER_CODE_STUB |
2759 #undef DEFINE_HYDROGEN_CODE_STUB | 2766 #undef DEFINE_HYDROGEN_CODE_STUB |
2760 #undef DEFINE_CODE_STUB | 2767 #undef DEFINE_CODE_STUB |
2761 #undef DEFINE_CODE_STUB_BASE | 2768 #undef DEFINE_CODE_STUB_BASE |
2762 } } // namespace v8::internal | 2769 } } // namespace v8::internal |
2763 | 2770 |
2764 #endif // V8_CODE_STUBS_H_ | 2771 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |