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

Side by Side Diff: src/factory.cc

Issue 12764003: Added an Isolate parameter to some HashTable/Dictionary methods. TypeFeedbackOracle tweaks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: TypeFeedbackOracle Created 7 years, 9 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/compilation-cache.cc ('k') | src/heap.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 CALL_HEAP_FUNCTION( 66 CALL_HEAP_FUNCTION(
67 isolate(), 67 isolate(),
68 isolate()->heap()->AllocateUninitializedFixedDoubleArray(size, pretenure), 68 isolate()->heap()->AllocateUninitializedFixedDoubleArray(size, pretenure),
69 FixedDoubleArray); 69 FixedDoubleArray);
70 } 70 }
71 71
72 72
73 Handle<NameDictionary> Factory::NewNameDictionary(int at_least_space_for) { 73 Handle<NameDictionary> Factory::NewNameDictionary(int at_least_space_for) {
74 ASSERT(0 <= at_least_space_for); 74 ASSERT(0 <= at_least_space_for);
75 CALL_HEAP_FUNCTION(isolate(), 75 CALL_HEAP_FUNCTION(isolate(),
76 NameDictionary::Allocate(at_least_space_for), 76 NameDictionary::Allocate(isolate()->heap(),
77 at_least_space_for),
77 NameDictionary); 78 NameDictionary);
78 } 79 }
79 80
80 81
81 Handle<SeededNumberDictionary> Factory::NewSeededNumberDictionary( 82 Handle<SeededNumberDictionary> Factory::NewSeededNumberDictionary(
82 int at_least_space_for) { 83 int at_least_space_for) {
83 ASSERT(0 <= at_least_space_for); 84 ASSERT(0 <= at_least_space_for);
84 CALL_HEAP_FUNCTION(isolate(), 85 CALL_HEAP_FUNCTION(isolate(),
85 SeededNumberDictionary::Allocate(at_least_space_for), 86 SeededNumberDictionary::Allocate(isolate()->heap(),
87 at_least_space_for),
86 SeededNumberDictionary); 88 SeededNumberDictionary);
87 } 89 }
88 90
89 91
90 Handle<UnseededNumberDictionary> Factory::NewUnseededNumberDictionary( 92 Handle<UnseededNumberDictionary> Factory::NewUnseededNumberDictionary(
91 int at_least_space_for) { 93 int at_least_space_for) {
92 ASSERT(0 <= at_least_space_for); 94 ASSERT(0 <= at_least_space_for);
93 CALL_HEAP_FUNCTION(isolate(), 95 CALL_HEAP_FUNCTION(isolate(),
94 UnseededNumberDictionary::Allocate(at_least_space_for), 96 UnseededNumberDictionary::Allocate(isolate()->heap(),
97 at_least_space_for),
95 UnseededNumberDictionary); 98 UnseededNumberDictionary);
96 } 99 }
97 100
98 101
99 Handle<ObjectHashSet> Factory::NewObjectHashSet(int at_least_space_for) { 102 Handle<ObjectHashSet> Factory::NewObjectHashSet(int at_least_space_for) {
100 ASSERT(0 <= at_least_space_for); 103 ASSERT(0 <= at_least_space_for);
101 CALL_HEAP_FUNCTION(isolate(), 104 CALL_HEAP_FUNCTION(isolate(),
102 ObjectHashSet::Allocate(at_least_space_for), 105 ObjectHashSet::Allocate(isolate()->heap(),
106 at_least_space_for),
103 ObjectHashSet); 107 ObjectHashSet);
104 } 108 }
105 109
106 110
107 Handle<ObjectHashTable> Factory::NewObjectHashTable(int at_least_space_for) { 111 Handle<ObjectHashTable> Factory::NewObjectHashTable(int at_least_space_for) {
108 ASSERT(0 <= at_least_space_for); 112 ASSERT(0 <= at_least_space_for);
109 CALL_HEAP_FUNCTION(isolate(), 113 CALL_HEAP_FUNCTION(isolate(),
110 ObjectHashTable::Allocate(at_least_space_for), 114 ObjectHashTable::Allocate(isolate()->heap(),
115 at_least_space_for),
111 ObjectHashTable); 116 ObjectHashTable);
112 } 117 }
113 118
114 119
115 Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors, 120 Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors,
116 int slack) { 121 int slack) {
117 ASSERT(0 <= number_of_descriptors); 122 ASSERT(0 <= number_of_descriptors);
118 CALL_HEAP_FUNCTION(isolate(), 123 CALL_HEAP_FUNCTION(isolate(),
119 DescriptorArray::Allocate(number_of_descriptors, slack), 124 DescriptorArray::Allocate(number_of_descriptors, slack),
120 DescriptorArray); 125 DescriptorArray);
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 obj = Handle<FunctionTemplateInfo>::cast(parent); 1362 obj = Handle<FunctionTemplateInfo>::cast(parent);
1358 } 1363 }
1359 1364
1360 ASSERT(result->shared()->IsApiFunction()); 1365 ASSERT(result->shared()->IsApiFunction());
1361 return result; 1366 return result;
1362 } 1367 }
1363 1368
1364 1369
1365 Handle<MapCache> Factory::NewMapCache(int at_least_space_for) { 1370 Handle<MapCache> Factory::NewMapCache(int at_least_space_for) {
1366 CALL_HEAP_FUNCTION(isolate(), 1371 CALL_HEAP_FUNCTION(isolate(),
1367 MapCache::Allocate(at_least_space_for), MapCache); 1372 MapCache::Allocate(isolate()->heap(),
1373 at_least_space_for),
1374 MapCache);
1368 } 1375 }
1369 1376
1370 1377
1371 MUST_USE_RESULT static MaybeObject* UpdateMapCacheWith(Context* context, 1378 MUST_USE_RESULT static MaybeObject* UpdateMapCacheWith(Context* context,
1372 FixedArray* keys, 1379 FixedArray* keys,
1373 Map* map) { 1380 Map* map) {
1374 Object* result; 1381 Object* result;
1375 { MaybeObject* maybe_result = 1382 { MaybeObject* maybe_result =
1376 MapCache::cast(context->map_cache())->Put(keys, map); 1383 MapCache::cast(context->map_cache())->Put(keys, map);
1377 if (!maybe_result->ToObject(&result)) return maybe_result; 1384 if (!maybe_result->ToObject(&result)) return maybe_result;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 return Handle<Object>::null(); 1477 return Handle<Object>::null();
1471 } 1478 }
1472 1479
1473 1480
1474 Handle<Object> Factory::ToBoolean(bool value) { 1481 Handle<Object> Factory::ToBoolean(bool value) {
1475 return value ? true_value() : false_value(); 1482 return value ? true_value() : false_value();
1476 } 1483 }
1477 1484
1478 1485
1479 } } // namespace v8::internal 1486 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compilation-cache.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698