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: test/cctest/test-alloc.cc

Issue 228333003: Handlefy Descriptor and other code in objects.cc (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Formatting stuff. 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/transitions.cc ('k') | no next file » | 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 Handle<Foreign> foreign = factory->NewForeign(&kDescriptor); 135 Handle<Foreign> foreign = factory->NewForeign(&kDescriptor);
136 Handle<String> name = 136 Handle<String> name =
137 factory->NewStringFromAscii(Vector<const char>("get", 3)); 137 factory->NewStringFromAscii(Vector<const char>("get", 3));
138 ASSERT(instance_descriptors->IsEmpty()); 138 ASSERT(instance_descriptors->IsEmpty());
139 139
140 Handle<DescriptorArray> new_descriptors = factory->NewDescriptorArray(0, 1); 140 Handle<DescriptorArray> new_descriptors = factory->NewDescriptorArray(0, 1);
141 141
142 v8::internal::DescriptorArray::WhitenessWitness witness(*new_descriptors); 142 v8::internal::DescriptorArray::WhitenessWitness witness(*new_descriptors);
143 map->set_instance_descriptors(*new_descriptors); 143 map->set_instance_descriptors(*new_descriptors);
144 144
145 CallbacksDescriptor d(*name, 145 CallbacksDescriptor d(name,
146 *foreign, 146 foreign,
147 static_cast<PropertyAttributes>(0)); 147 static_cast<PropertyAttributes>(0));
148 map->AppendDescriptor(&d, witness); 148 map->AppendDescriptor(&d, witness);
149 149
150 // Add the Foo constructor the global object. 150 // Add the Foo constructor the global object.
151 env->Global()->Set(v8::String::NewFromUtf8(CcTest::isolate(), "Foo"), 151 env->Global()->Set(v8::String::NewFromUtf8(CcTest::isolate(), "Foo"),
152 v8::Utils::ToLocal(function)); 152 v8::Utils::ToLocal(function));
153 // Call the accessor through JavaScript. 153 // Call the accessor through JavaScript.
154 v8::Handle<v8::Value> result = v8::Script::Compile( 154 v8::Handle<v8::Value> result = v8::Script::Compile(
155 v8::String::NewFromUtf8(CcTest::isolate(), "(new Foo).get"))->Run(); 155 v8::String::NewFromUtf8(CcTest::isolate(), "(new Foo).get"))->Run();
156 CHECK_EQ(42, result->Int32Value()); 156 CHECK_EQ(42, result->Int32Value());
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 if (index < blocks.length() - 1) { 220 if (index < blocks.length() - 1) {
221 blocks[index] = blocks.RemoveLast(); 221 blocks[index] = blocks.RemoveLast();
222 } else { 222 } else {
223 blocks.RemoveLast(); 223 blocks.RemoveLast();
224 } 224 }
225 } 225 }
226 } 226 }
227 227
228 code_range.TearDown(); 228 code_range.TearDown();
229 } 229 }
OLDNEW
« no previous file with comments | « src/transitions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698