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

Side by Side Diff: src/ic.h

Issue 12340112: Polymorphism support for load IC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added ARM port, introduced GenerateTailCall Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 Failure* TypeError(const char* type, 158 Failure* TypeError(const char* type,
159 Handle<Object> object, 159 Handle<Object> object,
160 Handle<Object> key); 160 Handle<Object> key);
161 Failure* ReferenceError(const char* type, Handle<String> name); 161 Failure* ReferenceError(const char* type, Handle<String> name);
162 162
163 // Access the target code for the given IC address. 163 // Access the target code for the given IC address.
164 static inline Code* GetTargetAtAddress(Address address); 164 static inline Code* GetTargetAtAddress(Address address);
165 static inline void SetTargetAtAddress(Address address, Code* target); 165 static inline void SetTargetAtAddress(Address address, Code* target);
166 static void PostPatching(Address address, Code* target, Code* old_target); 166 static void PostPatching(Address address, Code* target, Code* old_target);
167 167
168 virtual void UpdateMonomorphicIC(Handle<JSObject> receiver,
169 Handle<Code> handler,
170 Handle<String> name) {
171 set_target(*handler);
172 }
173 bool UpdatePolymorphicIC(State state,
174 StrictModeFlag strict_mode,
175 Handle<JSObject> receiver,
176 Handle<String> name,
177 Handle<Code> code);
168 void PatchCache(State state, 178 void PatchCache(State state,
169 StrictModeFlag strict_mode, 179 StrictModeFlag strict_mode,
170 Handle<JSObject> receiver, 180 Handle<JSObject> receiver,
171 Handle<String> name, 181 Handle<String> name,
172 Handle<Code> code); 182 Handle<Code> code);
173 virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code); 183 virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code);
174 virtual Handle<Code> megamorphic_stub() { 184 virtual Handle<Code> megamorphic_stub() {
175 UNREACHABLE(); 185 UNREACHABLE();
176 return Handle<Code>::null(); 186 return Handle<Code>::null();
177 } 187 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 virtual Handle<Code> megamorphic_stub() { 380 virtual Handle<Code> megamorphic_stub() {
371 return isolate()->builtins()->LoadIC_Megamorphic(); 381 return isolate()->builtins()->LoadIC_Megamorphic();
372 } 382 }
373 383
374 // Update the inline cache and the global stub cache based on the 384 // Update the inline cache and the global stub cache based on the
375 // lookup result. 385 // lookup result.
376 void UpdateCaches(LookupResult* lookup, 386 void UpdateCaches(LookupResult* lookup,
377 State state, 387 State state,
378 Handle<Object> object, 388 Handle<Object> object,
379 Handle<String> name); 389 Handle<String> name);
380 virtual Handle<Code> ComputeLoadMonomorphic(LookupResult* lookup, 390 virtual void UpdateMonomorphicIC(Handle<JSObject> receiver,
381 Handle<JSObject> receiver, 391 Handle<Code> handler,
382 Handle<String> name); 392 Handle<String> name);
393 virtual Handle<Code> ComputeLoadHandler(LookupResult* lookup,
394 Handle<JSObject> receiver,
395 Handle<String> name);
383 396
384 private: 397 private:
385 // Stub accessors. 398 // Stub accessors.
386 static Handle<Code> initialize_stub() { 399 static Handle<Code> initialize_stub() {
387 return Isolate::Current()->builtins()->LoadIC_Initialize(); 400 return Isolate::Current()->builtins()->LoadIC_Initialize();
388 } 401 }
389 virtual Handle<Code> pre_monomorphic_stub() { 402 virtual Handle<Code> pre_monomorphic_stub() {
390 return isolate()->builtins()->LoadIC_PreMonomorphic(); 403 return isolate()->builtins()->LoadIC_PreMonomorphic();
391 } 404 }
392 405
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 Handle<Code> LoadElementStub(Handle<JSObject> receiver); 454 Handle<Code> LoadElementStub(Handle<JSObject> receiver);
442 455
443 virtual Handle<Code> megamorphic_stub() { 456 virtual Handle<Code> megamorphic_stub() {
444 return isolate()->builtins()->KeyedLoadIC_Generic(); 457 return isolate()->builtins()->KeyedLoadIC_Generic();
445 } 458 }
446 virtual Handle<Code> generic_stub() const { 459 virtual Handle<Code> generic_stub() const {
447 return isolate()->builtins()->KeyedLoadIC_Generic(); 460 return isolate()->builtins()->KeyedLoadIC_Generic();
448 } 461 }
449 462
450 // Update the inline cache. 463 // Update the inline cache.
451 virtual Handle<Code> ComputeLoadMonomorphic(LookupResult* lookup, 464 virtual void UpdateMonomorphicIC(Handle<JSObject> receiver,
452 Handle<JSObject> receiver, 465 Handle<Code> handler,
453 Handle<String> name); 466 Handle<String> name);
467 virtual Handle<Code> ComputeLoadHandler(LookupResult* lookup,
468 Handle<JSObject> receiver,
469 Handle<String> name);
454 virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code) { } 470 virtual void UpdateMegamorphicCache(Map* map, String* name, Code* code) { }
455 471
456 private: 472 private:
457 // Stub accessors. 473 // Stub accessors.
458 static Handle<Code> initialize_stub() { 474 static Handle<Code> initialize_stub() {
459 return Isolate::Current()->builtins()->KeyedLoadIC_Initialize(); 475 return Isolate::Current()->builtins()->KeyedLoadIC_Initialize();
460 } 476 }
461 virtual Handle<Code> pre_monomorphic_stub() { 477 virtual Handle<Code> pre_monomorphic_stub() {
462 return isolate()->builtins()->KeyedLoadIC_PreMonomorphic(); 478 return isolate()->builtins()->KeyedLoadIC_PreMonomorphic();
463 } 479 }
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 // Helper for BinaryOpIC and CompareIC. 835 // Helper for BinaryOpIC and CompareIC.
820 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; 836 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK };
821 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); 837 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check);
822 838
823 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_Miss); 839 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_Miss);
824 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure); 840 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure);
825 841
826 } } // namespace v8::internal 842 } } // namespace v8::internal
827 843
828 #endif // V8_IC_H_ 844 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698