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

Side by Side Diff: runtime/vm/raw_object.h

Issue 2598623002: Cache hash code for closures. (Closed)
Patch Set: remove redundant assertion 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 | « runtime/vm/object.cc ('k') | runtime/vm/raw_object_snapshot.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 (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 #ifndef RUNTIME_VM_RAW_OBJECT_H_ 5 #ifndef RUNTIME_VM_RAW_OBJECT_H_
6 #define RUNTIME_VM_RAW_OBJECT_H_ 6 #define RUNTIME_VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/atomic.h" 9 #include "vm/atomic.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 private: 855 private:
856 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); 856 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData);
857 857
858 RawObject** from() { 858 RawObject** from() {
859 return reinterpret_cast<RawObject**>(&ptr()->context_scope_); 859 return reinterpret_cast<RawObject**>(&ptr()->context_scope_);
860 } 860 }
861 RawContextScope* context_scope_; 861 RawContextScope* context_scope_;
862 RawFunction* parent_function_; // Enclosing function of this local function. 862 RawFunction* parent_function_; // Enclosing function of this local function.
863 RawType* signature_type_; 863 RawType* signature_type_;
864 RawInstance* closure_; // Closure object for static implicit closures. 864 RawInstance* closure_; // Closure object for static implicit closures.
865 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->closure_); } 865 RawObject** to_snapshot() {
866 return reinterpret_cast<RawObject**>(&ptr()->closure_);
867 }
868 RawObject* hash_;
869 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->hash_); }
866 870
867 friend class Function; 871 friend class Function;
868 }; 872 };
869 873
870 874
871 class RawSignatureData : public RawObject { 875 class RawSignatureData : public RawObject {
872 private: 876 private:
873 RAW_HEAP_OBJECT_IMPLEMENTATION(SignatureData); 877 RAW_HEAP_OBJECT_IMPLEMENTATION(SignatureData);
874 878
875 RawObject** from() { 879 RawObject** from() {
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
2418 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2422 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2419 kTypedDataInt8ArrayViewCid + 15); 2423 kTypedDataInt8ArrayViewCid + 15);
2420 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2424 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2421 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2425 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2422 return (kNullCid - kTypedDataInt8ArrayCid); 2426 return (kNullCid - kTypedDataInt8ArrayCid);
2423 } 2427 }
2424 2428
2425 } // namespace dart 2429 } // namespace dart
2426 2430
2427 #endif // RUNTIME_VM_RAW_OBJECT_H_ 2431 #endif // RUNTIME_VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698