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

Side by Side Diff: src/objects.h

Issue 238113003: Use a wrapper for copying object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/heap.cc ('k') | src/objects.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 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 PropertyAttributes attributes, 2140 PropertyAttributes attributes,
2141 StrictMode strict_mode, 2141 StrictMode strict_mode,
2142 StoreFromKeyed store_from_keyed); 2142 StoreFromKeyed store_from_keyed);
2143 2143
2144 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); 2144 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver);
2145 }; 2145 };
2146 2146
2147 // Forward declaration for JSObject::GetOrCreateHiddenPropertiesHashTable. 2147 // Forward declaration for JSObject::GetOrCreateHiddenPropertiesHashTable.
2148 class ObjectHashTable; 2148 class ObjectHashTable;
2149 2149
2150 // Forward declaration for JSObject::Copy.
2151 class AllocationSite;
2152
2153
2150 // The JSObject describes real heap allocated JavaScript objects with 2154 // The JSObject describes real heap allocated JavaScript objects with
2151 // properties. 2155 // properties.
2152 // Note that the map of JSObject changes during execution to enable inline 2156 // Note that the map of JSObject changes during execution to enable inline
2153 // caching. 2157 // caching.
2154 class JSObject: public JSReceiver { 2158 class JSObject: public JSReceiver {
2155 public: 2159 public:
2156 // [properties]: Backing storage for properties. 2160 // [properties]: Backing storage for properties.
2157 // properties is a FixedArray in the fast case and a Dictionary in the 2161 // properties is a FixedArray in the fast case and a Dictionary in the
2158 // slow case. 2162 // slow case.
2159 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties. 2163 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties.
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
2648 2652
2649 // Called the first time an object is observed with ES7 Object.observe. 2653 // Called the first time an object is observed with ES7 Object.observe.
2650 static void SetObserved(Handle<JSObject> object); 2654 static void SetObserved(Handle<JSObject> object);
2651 2655
2652 // Copy object. 2656 // Copy object.
2653 enum DeepCopyHints { 2657 enum DeepCopyHints {
2654 kNoHints = 0, 2658 kNoHints = 0,
2655 kObjectIsShallowArray = 1 2659 kObjectIsShallowArray = 1
2656 }; 2660 };
2657 2661
2662 static Handle<JSObject> Copy(Handle<JSObject> object,
2663 Handle<AllocationSite> site);
2658 static Handle<JSObject> Copy(Handle<JSObject> object); 2664 static Handle<JSObject> Copy(Handle<JSObject> object);
2659 static Handle<JSObject> DeepCopy(Handle<JSObject> object, 2665 static Handle<JSObject> DeepCopy(Handle<JSObject> object,
2660 AllocationSiteUsageContext* site_context, 2666 AllocationSiteUsageContext* site_context,
2661 DeepCopyHints hints = kNoHints); 2667 DeepCopyHints hints = kNoHints);
2662 static Handle<JSObject> DeepWalk(Handle<JSObject> object, 2668 static Handle<JSObject> DeepWalk(Handle<JSObject> object,
2663 AllocationSiteCreationContext* site_context); 2669 AllocationSiteCreationContext* site_context);
2664 2670
2665 static Handle<Object> GetDataProperty(Handle<JSObject> object, 2671 static Handle<Object> GetDataProperty(Handle<JSObject> object,
2666 Handle<Name> key); 2672 Handle<Name> key);
2667 2673
(...skipping 8387 matching lines...) Expand 10 before | Expand all | Expand 10 after
11055 } else { 11061 } else {
11056 value &= ~(1 << bit_position); 11062 value &= ~(1 << bit_position);
11057 } 11063 }
11058 return value; 11064 return value;
11059 } 11065 }
11060 }; 11066 };
11061 11067
11062 } } // namespace v8::internal 11068 } } // namespace v8::internal
11063 11069
11064 #endif // V8_OBJECTS_H_ 11070 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698