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

Side by Side Diff: runtime/vm/bootstrap.cc

Issue 2983973002: Revert "Improve hashCode for closure objects" (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « runtime/lib/function.dart ('k') | runtime/vm/bootstrap_natives.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bootstrap.h" 5 #include "vm/bootstrap.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/bootstrap_natives.h" 9 #include "vm/bootstrap_natives.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // instances. This allows us to just finalize function types without going 225 // instances. This allows us to just finalize function types without going
226 // through the hoops of trying to compile their scope class. 226 // through the hoops of trying to compile their scope class.
227 ObjectStore* object_store = thread->isolate()->object_store(); 227 ObjectStore* object_store = thread->isolate()->object_store();
228 Zone* zone = thread->zone(); 228 Zone* zone = thread->zone();
229 Class& cls = Class::Handle(zone, object_store->closure_class()); 229 Class& cls = Class::Handle(zone, object_store->closure_class());
230 Compiler::CompileClass(cls); 230 Compiler::CompileClass(cls);
231 231
232 #if defined(DEBUG) 232 #if defined(DEBUG)
233 // Verify that closure field offsets are identical in Dart and C++. 233 // Verify that closure field offsets are identical in Dart and C++.
234 const Array& fields = Array::Handle(zone, cls.fields()); 234 const Array& fields = Array::Handle(zone, cls.fields());
235 ASSERT(fields.Length() == 5); 235 ASSERT(fields.Length() == 4);
236 Field& field = Field::Handle(zone); 236 Field& field = Field::Handle(zone);
237 field ^= fields.At(0); 237 field ^= fields.At(0);
238 ASSERT(field.Offset() == Closure::instantiator_type_arguments_offset()); 238 ASSERT(field.Offset() == Closure::instantiator_type_arguments_offset());
239 field ^= fields.At(1); 239 field ^= fields.At(1);
240 ASSERT(field.Offset() == Closure::function_type_arguments_offset()); 240 ASSERT(field.Offset() == Closure::function_type_arguments_offset());
241 field ^= fields.At(2); 241 field ^= fields.At(2);
242 ASSERT(field.Offset() == Closure::function_offset()); 242 ASSERT(field.Offset() == Closure::function_offset());
243 field ^= fields.At(3); 243 field ^= fields.At(3);
244 ASSERT(field.Offset() == Closure::context_offset()); 244 ASSERT(field.Offset() == Closure::context_offset());
245 field ^= fields.At(4);
246 ASSERT(field.Offset() == Closure::hash_offset());
247 #endif // defined(DEBUG) 245 #endif // defined(DEBUG)
248 246
249 // Eagerly compile Bool class, bool constants are used from within compiler. 247 // Eagerly compile Bool class, bool constants are used from within compiler.
250 cls = object_store->bool_class(); 248 cls = object_store->bool_class();
251 Compiler::CompileClass(cls); 249 Compiler::CompileClass(cls);
252 } 250 }
253 251
254 static RawError* BootstrapFromSource(Thread* thread) { 252 static RawError* BootstrapFromSource(Thread* thread) {
255 Isolate* isolate = thread->isolate(); 253 Isolate* isolate = thread->isolate();
256 Zone* zone = thread->zone(); 254 Zone* zone = thread->zone();
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 lib.Register(thread); 373 lib.Register(thread);
376 isolate->object_store()->set_bootstrap_library(id, lib); 374 isolate->object_store()->set_bootstrap_library(id, lib);
377 } 375 }
378 } 376 }
379 377
380 return (kernel_program == NULL) ? BootstrapFromSource(thread) 378 return (kernel_program == NULL) ? BootstrapFromSource(thread)
381 : BootstrapFromKernel(thread, kernel_program); 379 : BootstrapFromKernel(thread, kernel_program);
382 } 380 }
383 381
384 } // namespace dart 382 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/function.dart ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698