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

Side by Side Diff: src/factory.cc

Issue 584943002: Make Map::Create always use the Object function, and remove the unused inobject properties (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/bootstrapper.cc ('k') | src/objects.h » ('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 #include "src/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 2313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2324 context->set_map_cache(*new_cache); 2324 context->set_map_cache(*new_cache);
2325 } 2325 }
2326 // Check to see whether there is a matching element in the cache. 2326 // Check to see whether there is a matching element in the cache.
2327 Handle<MapCache> cache = 2327 Handle<MapCache> cache =
2328 Handle<MapCache>(MapCache::cast(context->map_cache())); 2328 Handle<MapCache>(MapCache::cast(context->map_cache()));
2329 Handle<Object> result = Handle<Object>(cache->Lookup(*keys), isolate()); 2329 Handle<Object> result = Handle<Object>(cache->Lookup(*keys), isolate());
2330 if (result->IsMap()) return Handle<Map>::cast(result); 2330 if (result->IsMap()) return Handle<Map>::cast(result);
2331 int length = keys->length(); 2331 int length = keys->length();
2332 // Create a new map and add it to the cache. Reuse the initial map of the 2332 // Create a new map and add it to the cache. Reuse the initial map of the
2333 // Object function if the literal has no predeclared properties. 2333 // Object function if the literal has no predeclared properties.
2334 Handle<Map> map = 2334 Handle<Map> map = length == 0
2335 length == 0 ? handle(context->object_function()->initial_map()) 2335 ? handle(context->object_function()->initial_map())
2336 : Map::Create(handle(context->object_function()), length); 2336 : Map::Create(isolate(), length);
2337 AddToMapCache(context, keys, map); 2337 AddToMapCache(context, keys, map);
2338 return map; 2338 return map;
2339 } 2339 }
2340 2340
2341 2341
2342 void Factory::SetRegExpAtomData(Handle<JSRegExp> regexp, 2342 void Factory::SetRegExpAtomData(Handle<JSRegExp> regexp,
2343 JSRegExp::Type type, 2343 JSRegExp::Type type,
2344 Handle<String> source, 2344 Handle<String> source,
2345 JSRegExp::Flags flags, 2345 JSRegExp::Flags flags,
2346 Handle<Object> data) { 2346 Handle<Object> data) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 return Handle<Object>::null(); 2397 return Handle<Object>::null();
2398 } 2398 }
2399 2399
2400 2400
2401 Handle<Object> Factory::ToBoolean(bool value) { 2401 Handle<Object> Factory::ToBoolean(bool value) {
2402 return value ? true_value() : false_value(); 2402 return value ? true_value() : false_value();
2403 } 2403 }
2404 2404
2405 2405
2406 } } // namespace v8::internal 2406 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698