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

Side by Side Diff: test/cctest/test-alloc.cc

Issue 11188031: Move DescriptorArray into the map (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: remove padding area Created 8 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/x64/macro-assembler-x64.cc ('k') | test/cctest/test-heap-profiler.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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 Handle<Map> map(function->initial_map()); 151 Handle<Map> map(function->initial_map());
152 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); 152 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors());
153 Handle<Foreign> foreign = FACTORY->NewForeign(&kDescriptor); 153 Handle<Foreign> foreign = FACTORY->NewForeign(&kDescriptor);
154 Handle<String> name = 154 Handle<String> name =
155 FACTORY->NewStringFromAscii(Vector<const char>("get", 3)); 155 FACTORY->NewStringFromAscii(Vector<const char>("get", 3));
156 ASSERT(instance_descriptors->IsEmpty()); 156 ASSERT(instance_descriptors->IsEmpty());
157 157
158 Handle<DescriptorArray> new_descriptors = FACTORY->NewDescriptorArray(0, 1); 158 Handle<DescriptorArray> new_descriptors = FACTORY->NewDescriptorArray(0, 1);
159 159
160 v8::internal::DescriptorArray::WhitenessWitness witness(*new_descriptors); 160 v8::internal::DescriptorArray::WhitenessWitness witness(*new_descriptors);
161 v8::internal::Map::SetDescriptors(map, new_descriptors); 161 map->set_instance_descriptors(*new_descriptors);
162 162
163 CallbacksDescriptor d(*name, 163 CallbacksDescriptor d(*name,
164 *foreign, 164 *foreign,
165 static_cast<PropertyAttributes>(0), 165 static_cast<PropertyAttributes>(0),
166 v8::internal::PropertyDetails::kInitialIndex); 166 v8::internal::PropertyDetails::kInitialIndex);
167 map->AppendDescriptor(&d, witness); 167 map->AppendDescriptor(&d, witness);
168 168
169 // Add the Foo constructor the global object. 169 // Add the Foo constructor the global object.
170 env->Global()->Set(v8::String::New("Foo"), v8::Utils::ToLocal(function)); 170 env->Global()->Set(v8::String::New("Foo"), v8::Utils::ToLocal(function));
171 // Call the accessor through JavaScript. 171 // Call the accessor through JavaScript.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 blocks[index] = blocks.RemoveLast(); 238 blocks[index] = blocks.RemoveLast();
239 } else { 239 } else {
240 blocks.RemoveLast(); 240 blocks.RemoveLast();
241 } 241 }
242 } 242 }
243 } 243 }
244 244
245 code_range->TearDown(); 245 code_range->TearDown();
246 delete code_range; 246 delete code_range;
247 } 247 }
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698