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

Side by Side Diff: src/ic.h

Issue 8233011: Refactor and fix polymorphic KeyedStoreIC creation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix nits Created 9 years, 2 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 return NULL; 361 return NULL;
362 } 362 }
363 363
364 virtual Code::Kind kind() const = 0; 364 virtual Code::Kind kind() const = 0;
365 365
366 MaybeObject* ComputeStub(JSObject* receiver, 366 MaybeObject* ComputeStub(JSObject* receiver,
367 StubKind stub_kind, 367 StubKind stub_kind,
368 StrictModeFlag strict_mode, 368 StrictModeFlag strict_mode,
369 Code* default_stub); 369 Code* default_stub);
370 370
371 virtual MaybeObject* ConstructMegamorphicStub( 371 virtual MaybeObject* ComputePolymorphicStub(MapList* receiver_maps,
372 MapList* receiver_maps, 372 StrictModeFlag strict_mode) = 0;
373 CodeList* targets,
374 StrictModeFlag strict_mode) = 0;
375
376 private:
377 void GetReceiverMapsForStub(Code* stub, MapList* result);
378 373
379 MaybeObject* ComputeMonomorphicStubWithoutMapCheck( 374 MaybeObject* ComputeMonomorphicStubWithoutMapCheck(
380 Map* receiver_map, 375 Map* receiver_map,
381 StrictModeFlag strict_mode); 376 StrictModeFlag strict_mode);
382 377
378 private:
379 void GetReceiverMapsForStub(Code* stub, MapList* result);
380
383 MaybeObject* ComputeMonomorphicStub(JSObject* receiver, 381 MaybeObject* ComputeMonomorphicStub(JSObject* receiver,
384 StubKind stub_kind, 382 StubKind stub_kind,
385 StrictModeFlag strict_mode, 383 StrictModeFlag strict_mode,
386 Code* default_stub); 384 Code* default_stub);
387 385
388 MaybeObject* ComputePolymorphicStubWithTransition(JSObject* receiver,
389 MapList* receiver_maps,
390 Map* new_map,
391 StrictModeFlag strict_mode);
392
393 MaybeObject* ComputePolymorphicStub(MapList* receiver_maps,
394 StrictModeFlag strict_mode);
395
396 MaybeObject* ComputeTransitionedMap(JSObject* receiver, StubKind stub_kind); 386 MaybeObject* ComputeTransitionedMap(JSObject* receiver, StubKind stub_kind);
397 387
398 static bool IsTransitionStubKind(StubKind stub_kind) { 388 static bool IsTransitionStubKind(StubKind stub_kind) {
399 return stub_kind > STORE_NO_TRANSITION; 389 return stub_kind > STORE_NO_TRANSITION;
400 } 390 }
401 }; 391 };
402 392
403 393
404 class KeyedLoadIC: public KeyedIC { 394 class KeyedLoadIC: public KeyedIC {
405 public: 395 public:
(...skipping 27 matching lines...) Expand all
433 static const int kSlowCaseBitFieldMask = 423 static const int kSlowCaseBitFieldMask =
434 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); 424 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor);
435 425
436 virtual MaybeObject* GetElementStubWithoutMapCheck( 426 virtual MaybeObject* GetElementStubWithoutMapCheck(
437 bool is_js_array, 427 bool is_js_array,
438 ElementsKind elements_kind); 428 ElementsKind elements_kind);
439 429
440 protected: 430 protected:
441 virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; } 431 virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; }
442 432
443 virtual MaybeObject* ConstructMegamorphicStub( 433 virtual MaybeObject* ComputePolymorphicStub(
444 MapList* receiver_maps, 434 MapList* receiver_maps,
445 CodeList* targets,
446 StrictModeFlag strict_mode); 435 StrictModeFlag strict_mode);
447 436
448 virtual Code* string_stub() { 437 virtual Code* string_stub() {
449 return isolate()->builtins()->builtin( 438 return isolate()->builtins()->builtin(
450 Builtins::kKeyedLoadIC_String); 439 Builtins::kKeyedLoadIC_String);
451 } 440 }
452 441
453 private: 442 private:
454 // Update the inline cache. 443 // Update the inline cache.
455 void UpdateCaches(LookupResult* lookup, 444 void UpdateCaches(LookupResult* lookup,
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode); 573 static void GenerateGeneric(MacroAssembler* masm, StrictModeFlag strict_mode);
585 static void GenerateNonStrictArguments(MacroAssembler* masm); 574 static void GenerateNonStrictArguments(MacroAssembler* masm);
586 575
587 virtual MaybeObject* GetElementStubWithoutMapCheck( 576 virtual MaybeObject* GetElementStubWithoutMapCheck(
588 bool is_js_array, 577 bool is_js_array,
589 ElementsKind elements_kind); 578 ElementsKind elements_kind);
590 579
591 protected: 580 protected:
592 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; } 581 virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; }
593 582
594 virtual MaybeObject* ConstructMegamorphicStub( 583 virtual MaybeObject* ComputePolymorphicStub(
595 MapList* receiver_maps, 584 MapList* receiver_maps,
596 CodeList* targets,
597 StrictModeFlag strict_mode); 585 StrictModeFlag strict_mode);
598 586
599 private: 587 private:
600 // Update the inline cache. 588 // Update the inline cache.
601 void UpdateCaches(LookupResult* lookup, 589 void UpdateCaches(LookupResult* lookup,
602 State state, 590 State state,
603 StrictModeFlag strict_mode, 591 StrictModeFlag strict_mode,
604 Handle<JSObject> receiver, 592 Handle<JSObject> receiver,
605 Handle<String> name, 593 Handle<String> name,
606 Handle<Object> value); 594 Handle<Object> value);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 void patch(Code* code); 737 void patch(Code* code);
750 }; 738 };
751 739
752 740
753 // Helper for BinaryOpIC and CompareIC. 741 // Helper for BinaryOpIC and CompareIC.
754 void PatchInlinedSmiCode(Address address); 742 void PatchInlinedSmiCode(Address address);
755 743
756 } } // namespace v8::internal 744 } } // namespace v8::internal
757 745
758 #endif // V8_IC_H_ 746 #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