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

Side by Side Diff: src/factory.h

Issue 712943002: MapCache simplification. It is now a FixedArray that maps number of properties to a WeakCell with... (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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/contexts.h ('k') | src/factory.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_FACTORY_H_ 5 #ifndef V8_FACTORY_H_
6 #define V8_FACTORY_H_ 6 #define V8_FACTORY_H_
7 7
8 #include "src/isolate.h" 8 #include "src/isolate.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 Handle<JSMessageObject> NewJSMessageObject( 636 Handle<JSMessageObject> NewJSMessageObject(
637 Handle<String> type, 637 Handle<String> type,
638 Handle<JSArray> arguments, 638 Handle<JSArray> arguments,
639 int start_position, 639 int start_position,
640 int end_position, 640 int end_position,
641 Handle<Object> script, 641 Handle<Object> script,
642 Handle<Object> stack_frames); 642 Handle<Object> stack_frames);
643 643
644 Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared); 644 Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared);
645 645
646 // Return a map using the map cache in the native context. 646 // Return a map for given number of properties using the map cache in the
647 // The key the an ordered set of property names. 647 // native context.
648 Handle<Map> ObjectLiteralMapFromCache(Handle<Context> context, 648 Handle<Map> ObjectLiteralMapFromCache(Handle<Context> context,
649 Handle<FixedArray> keys); 649 int number_of_properties,
650 bool* is_result_from_cache);
650 651
651 // Creates a new FixedArray that holds the data associated with the 652 // Creates a new FixedArray that holds the data associated with the
652 // atom regexp and stores it in the regexp. 653 // atom regexp and stores it in the regexp.
653 void SetRegExpAtomData(Handle<JSRegExp> regexp, 654 void SetRegExpAtomData(Handle<JSRegExp> regexp,
654 JSRegExp::Type type, 655 JSRegExp::Type type,
655 Handle<String> source, 656 Handle<String> source,
656 JSRegExp::Flags flags, 657 JSRegExp::Flags flags,
657 Handle<Object> match_pattern); 658 Handle<Object> match_pattern);
658 659
659 // Creates a new FixedArray that holds the data associated with the 660 // Creates a new FixedArray that holds the data associated with the
(...skipping 22 matching lines...) Expand all
682 Handle<T> New(Handle<Map> map, AllocationSpace space); 683 Handle<T> New(Handle<Map> map, AllocationSpace space);
683 684
684 template<typename T> 685 template<typename T>
685 Handle<T> New(Handle<Map> map, 686 Handle<T> New(Handle<Map> map,
686 AllocationSpace space, 687 AllocationSpace space,
687 Handle<AllocationSite> allocation_site); 688 Handle<AllocationSite> allocation_site);
688 689
689 // Creates a code object that is not yet fully initialized yet. 690 // Creates a code object that is not yet fully initialized yet.
690 inline Handle<Code> NewCodeRaw(int object_size, bool immovable); 691 inline Handle<Code> NewCodeRaw(int object_size, bool immovable);
691 692
692 // Create a new map cache.
693 Handle<MapCache> NewMapCache(int at_least_space_for);
694
695 // Update the map cache in the native context with (keys, map)
696 Handle<MapCache> AddToMapCache(Handle<Context> context,
697 Handle<FixedArray> keys,
698 Handle<Map> map);
699
700 // Attempt to find the number in a small cache. If we finds it, return 693 // Attempt to find the number in a small cache. If we finds it, return
701 // the string representation of the number. Otherwise return undefined. 694 // the string representation of the number. Otherwise return undefined.
702 Handle<Object> GetNumberStringCache(Handle<Object> number); 695 Handle<Object> GetNumberStringCache(Handle<Object> number);
703 696
704 // Update the cache with a new number-string pair. 697 // Update the cache with a new number-string pair.
705 void SetNumberStringCache(Handle<Object> number, Handle<String> string); 698 void SetNumberStringCache(Handle<Object> number, Handle<String> string);
706 699
707 // Initializes a function with a shared part and prototype. 700 // Initializes a function with a shared part and prototype.
708 // Note: this code was factored out of NewFunction such that other parts of 701 // Note: this code was factored out of NewFunction such that other parts of
709 // the VM could use it. Specifically, a function that creates instances of 702 // the VM could use it. Specifically, a function that creates instances of
(...skipping 15 matching lines...) Expand all
725 // Reinitialize a JSProxy into an (empty) JS object of respective type and 718 // Reinitialize a JSProxy into an (empty) JS object of respective type and
726 // size, but keeping the original prototype. The receiver must have at least 719 // size, but keeping the original prototype. The receiver must have at least
727 // the size of the new object. The object is reinitialized and behaves as an 720 // the size of the new object. The object is reinitialized and behaves as an
728 // object that has been freshly allocated. 721 // object that has been freshly allocated.
729 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); 722 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size);
730 }; 723 };
731 724
732 } } // namespace v8::internal 725 } } // namespace v8::internal
733 726
734 #endif // V8_FACTORY_H_ 727 #endif // V8_FACTORY_H_
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698