Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: src/code-stubs.h

Issue 1100083002: Don't MISS if you read the hole from certain FastHoley arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: With ports and test. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after
2220 private: 2220 private:
2221 Code::Kind kind() const override { return Code::STORE_IC; } 2221 Code::Kind kind() const override { return Code::STORE_IC; }
2222 2222
2223 DEFINE_HANDLER_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub); 2223 DEFINE_HANDLER_CODE_STUB(StoreScriptContextField, ScriptContextFieldStub);
2224 }; 2224 };
2225 2225
2226 2226
2227 class LoadFastElementStub : public HydrogenCodeStub { 2227 class LoadFastElementStub : public HydrogenCodeStub {
2228 public: 2228 public:
2229 LoadFastElementStub(Isolate* isolate, bool is_js_array, 2229 LoadFastElementStub(Isolate* isolate, bool is_js_array,
2230 ElementsKind elements_kind) 2230 ElementsKind elements_kind,
2231 bool convert_hole_to_undefined = false)
2231 : HydrogenCodeStub(isolate) { 2232 : HydrogenCodeStub(isolate) {
2232 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | 2233 set_sub_minor_key(
2233 IsJSArrayBits::encode(is_js_array)); 2234 ElementsKindBits::encode(elements_kind) |
2235 IsJSArrayBits::encode(is_js_array) |
2236 CanConvertHoleToUndefined::encode(convert_hole_to_undefined));
2234 } 2237 }
2235 2238
2236 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } 2239 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); }
2240 bool convert_hole_to_undefined() const {
2241 return CanConvertHoleToUndefined::decode(sub_minor_key());
2242 }
2237 2243
2238 ElementsKind elements_kind() const { 2244 ElementsKind elements_kind() const {
2239 return ElementsKindBits::decode(sub_minor_key()); 2245 return ElementsKindBits::decode(sub_minor_key());
2240 } 2246 }
2241 2247
2242 private: 2248 private:
2243 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; 2249 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
2244 class IsJSArrayBits: public BitField<bool, 8, 1> {}; 2250 class IsJSArrayBits: public BitField<bool, 8, 1> {};
2251 class CanConvertHoleToUndefined : public BitField<bool, 9, 1> {};
2245 2252
2246 CallInterfaceDescriptor GetCallInterfaceDescriptor() override { 2253 CallInterfaceDescriptor GetCallInterfaceDescriptor() override {
2247 if (FLAG_vector_ics) { 2254 if (FLAG_vector_ics) {
2248 return VectorLoadICDescriptor(isolate()); 2255 return VectorLoadICDescriptor(isolate());
2249 } 2256 }
2250 return LoadDescriptor(isolate()); 2257 return LoadDescriptor(isolate());
2251 } 2258 }
2252 2259
2253 DEFINE_HYDROGEN_CODE_STUB(LoadFastElement, HydrogenCodeStub); 2260 DEFINE_HYDROGEN_CODE_STUB(LoadFastElement, HydrogenCodeStub);
2254 }; 2261 };
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
2754 2761
2755 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR 2762 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR
2756 #undef DEFINE_PLATFORM_CODE_STUB 2763 #undef DEFINE_PLATFORM_CODE_STUB
2757 #undef DEFINE_HANDLER_CODE_STUB 2764 #undef DEFINE_HANDLER_CODE_STUB
2758 #undef DEFINE_HYDROGEN_CODE_STUB 2765 #undef DEFINE_HYDROGEN_CODE_STUB
2759 #undef DEFINE_CODE_STUB 2766 #undef DEFINE_CODE_STUB
2760 #undef DEFINE_CODE_STUB_BASE 2767 #undef DEFINE_CODE_STUB_BASE
2761 } } // namespace v8::internal 2768 } } // namespace v8::internal
2762 2769
2763 #endif // V8_CODE_STUBS_H_ 2770 #endif // V8_CODE_STUBS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698