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

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

Issue 2595893002: [runtime] Remove specific Descriptor subclasses and add respective factory methods instead. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « src/property.cc ('k') | test/cctest/test-field-type-tracking.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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 Builtins::kEmptyFunction)); 147 Builtins::kEmptyFunction));
148 // Patch the map to have an accessor for "get". 148 // Patch the map to have an accessor for "get".
149 Handle<Map> map(function->initial_map()); 149 Handle<Map> map(function->initial_map());
150 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); 150 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors());
151 CHECK(instance_descriptors->IsEmpty()); 151 CHECK(instance_descriptors->IsEmpty());
152 152
153 PropertyAttributes attrs = NONE; 153 PropertyAttributes attrs = NONE;
154 Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs); 154 Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs);
155 Map::EnsureDescriptorSlack(map, 1); 155 Map::EnsureDescriptorSlack(map, 1);
156 156
157 AccessorConstantDescriptor d(Handle<Name>(Name::cast(foreign->name())), 157 Descriptor d = Descriptor::AccessorConstant(
158 foreign, attrs); 158 Handle<Name>(Name::cast(foreign->name())), foreign, attrs);
159 map->AppendDescriptor(&d); 159 map->AppendDescriptor(&d);
160 160
161 // Add the Foo constructor the global object. 161 // Add the Foo constructor the global object.
162 CHECK(env->Global() 162 CHECK(env->Global()
163 ->Set(env, v8::String::NewFromUtf8(CcTest::isolate(), "Foo", 163 ->Set(env, v8::String::NewFromUtf8(CcTest::isolate(), "Foo",
164 v8::NewStringType::kNormal) 164 v8::NewStringType::kNormal)
165 .ToLocalChecked(), 165 .ToLocalChecked(),
166 v8::Utils::CallableToLocal(function)) 166 v8::Utils::CallableToLocal(function))
167 .FromJust()); 167 .FromJust());
168 // Call the accessor through JavaScript. 168 // Call the accessor through JavaScript.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); 241 code_range.FreeRawMemory(blocks[index].base, blocks[index].size);
242 current_allocated -= blocks[index].size; 242 current_allocated -= blocks[index].size;
243 if (index < blocks.length() - 1) { 243 if (index < blocks.length() - 1) {
244 blocks[index] = blocks.RemoveLast(); 244 blocks[index] = blocks.RemoveLast();
245 } else { 245 } else {
246 blocks.RemoveLast(); 246 blocks.RemoveLast();
247 } 247 }
248 } 248 }
249 } 249 }
250 } 250 }
OLDNEW
« no previous file with comments | « src/property.cc ('k') | test/cctest/test-field-type-tracking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698