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

Side by Side Diff: src/ic.h

Issue 10532063: Optimistically assume that elements IC only transition once. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years, 6 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/hydrogen.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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 KeyedAccessGrowMode grow_mode) = 0; 444 KeyedAccessGrowMode grow_mode) = 0;
445 445
446 Handle<Code> ComputeMonomorphicStubWithoutMapCheck( 446 Handle<Code> ComputeMonomorphicStubWithoutMapCheck(
447 Handle<Map> receiver_map, 447 Handle<Map> receiver_map,
448 StrictModeFlag strict_mode, 448 StrictModeFlag strict_mode,
449 KeyedAccessGrowMode grow_mode); 449 KeyedAccessGrowMode grow_mode);
450 450
451 private: 451 private:
452 void GetReceiverMapsForStub(Handle<Code> stub, MapHandleList* result); 452 void GetReceiverMapsForStub(Handle<Code> stub, MapHandleList* result);
453 453
454 Handle<Code> ComputeMonomorphicStub(Handle<JSObject> receiver, 454 Handle<Code> ComputeMonomorphicStub(Handle<Map> receiver_map,
455 StubKind stub_kind, 455 StubKind stub_kind,
456 StrictModeFlag strict_mode, 456 StrictModeFlag strict_mode,
457 Handle<Code> default_stub); 457 Handle<Code> default_stub);
458 458
459 Handle<Map> ComputeTransitionedMap(Handle<JSObject> receiver, 459 Handle<Map> ComputeTransitionedMap(Handle<JSObject> receiver,
460 StubKind stub_kind); 460 StubKind stub_kind);
461 461
462 static bool IsTransitionStubKind(StubKind stub_kind) { 462 static bool IsTransitionStubKind(StubKind stub_kind) {
463 return stub_kind > STORE_NO_TRANSITION && 463 return stub_kind > STORE_NO_TRANSITION &&
464 stub_kind != STORE_AND_GROW_NO_TRANSITION; 464 stub_kind != STORE_AND_GROW_NO_TRANSITION;
465 } 465 }
466 466
467 static bool IsGrowStubKind(StubKind stub_kind) { 467 static bool IsGrowStubKind(StubKind stub_kind) {
468 return stub_kind >= STORE_AND_GROW_NO_TRANSITION; 468 return stub_kind >= STORE_AND_GROW_NO_TRANSITION;
469 } 469 }
470
471 static StubKind GetNoTransitionStubKind(StubKind stub_kind) {
472 if (!IsTransitionStubKind(stub_kind)) return stub_kind;
473 if (IsGrowStubKind(stub_kind)) return STORE_AND_GROW_NO_TRANSITION;
474 return STORE_NO_TRANSITION;
475 }
470 }; 476 };
471 477
472 478
473 class KeyedLoadIC: public KeyedIC { 479 class KeyedLoadIC: public KeyedIC {
474 public: 480 public:
475 explicit KeyedLoadIC(Isolate* isolate) : KeyedIC(isolate) { 481 explicit KeyedLoadIC(Isolate* isolate) : KeyedIC(isolate) {
476 ASSERT(target()->is_keyed_load_stub()); 482 ASSERT(target()->is_keyed_load_stub());
477 } 483 }
478 484
479 MUST_USE_RESULT MaybeObject* Load(State state, 485 MUST_USE_RESULT MaybeObject* Load(State state,
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 }; 837 };
832 838
833 839
834 // Helper for BinaryOpIC and CompareIC. 840 // Helper for BinaryOpIC and CompareIC.
835 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; 841 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK };
836 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check); 842 void PatchInlinedSmiCode(Address address, InlinedSmiCheck check);
837 843
838 } } // namespace v8::internal 844 } } // namespace v8::internal
839 845
840 #endif // V8_IC_H_ 846 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698