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

Side by Side Diff: src/ic/ic.h

Issue 755513003: Hydrogen: fix keyed loads with string keys (Closed) Base URL: gh:v8/v8@master
Patch Set: fixes Created 6 years 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_IC_H_ 5 #ifndef V8_IC_H_
6 #define V8_IC_H_ 6 #define V8_IC_H_
7 7
8 #include "src/ic/ic-state.h" 8 #include "src/ic/ic-state.h"
9 #include "src/macro-assembler.h" 9 #include "src/macro-assembler.h"
10 10
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 static void Clear(Isolate* isolate, Address address, Code* target, 428 static void Clear(Isolate* isolate, Address address, Code* target,
429 ConstantPoolArray* constant_pool); 429 ConstantPoolArray* constant_pool);
430 430
431 friend class IC; 431 friend class IC;
432 }; 432 };
433 433
434 434
435 class KeyedLoadIC : public LoadIC { 435 class KeyedLoadIC : public LoadIC {
436 public: 436 public:
437 // ExtraICState bits (building on IC)
438 class IcCheckTypeField : public BitField<IcCheckType, 1, 1> {};
439
440 static ExtraICState ComputeExtraICState(ContextualMode contextual_mode,
441 IcCheckType key_type) {
442 return LoadICState(contextual_mode).GetExtraICState() |
443 IcCheckTypeField::encode(key_type);
444 }
445
446 static IcCheckType GetKeyType(ExtraICState extra_state) {
447 return IcCheckTypeField::decode(extra_state);
448 }
449
437 explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate) 450 explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate)
438 : LoadIC(depth, isolate) { 451 : LoadIC(depth, isolate) {
439 DCHECK(target()->is_keyed_load_stub()); 452 DCHECK(target()->is_keyed_load_stub());
440 } 453 }
441 454
442 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, 455 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object,
443 Handle<Object> key); 456 Handle<Object> key);
444 457
445 // Code generator routines. 458 // Code generator routines.
446 static void GenerateMiss(MacroAssembler* masm); 459 static void GenerateMiss(MacroAssembler* masm);
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 745
733 // Support functions for interceptor handlers. 746 // Support functions for interceptor handlers.
734 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); 747 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly);
735 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); 748 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor);
736 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); 749 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor);
737 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); 750 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor);
738 } 751 }
739 } // namespace v8::internal 752 } // namespace v8::internal
740 753
741 #endif // V8_IC_H_ 754 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ic/ic.cc » ('j') | src/ic/ic-compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698