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

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

Issue 11970043: Improve function lookup speed by working with raw objects only. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | « runtime/vm/object.cc ('k') | runtime/vm/stack_frame.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 VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 kSignatureFunction, // represents a signature only without actual code. 536 kSignatureFunction, // represents a signature only without actual code.
537 kGetterFunction, // represents getter functions e.g: get foo() { .. }. 537 kGetterFunction, // represents getter functions e.g: get foo() { .. }.
538 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. 538 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }.
539 kConstructor, 539 kConstructor,
540 kImplicitGetter, // represents an implicit getter for fields. 540 kImplicitGetter, // represents an implicit getter for fields.
541 kImplicitSetter, // represents an implicit setter for fields. 541 kImplicitSetter, // represents an implicit setter for fields.
542 kConstImplicitGetter, // represents an implicit const getter for fields. 542 kConstImplicitGetter, // represents an implicit const getter for fields.
543 }; 543 };
544 544
545 private: 545 private:
546 friend class Class;
546 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); 547 RAW_HEAP_OBJECT_IMPLEMENTATION(Function);
547 548
548 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 549 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
549 RawString* name_; 550 RawString* name_;
550 RawObject* owner_; // Class or patch class where this function was defined. 551 RawObject* owner_; // Class or patch class where this function was defined.
551 RawAbstractType* result_type_; 552 RawAbstractType* result_type_;
552 RawArray* parameter_types_; 553 RawArray* parameter_types_;
553 RawArray* parameter_names_; 554 RawArray* parameter_names_;
554 RawCode* code_; // Compiled code for the function. 555 RawCode* code_; // Compiled code for the function.
555 RawCode* unoptimized_code_; // Unoptimized code, keep it after optimization. 556 RawCode* unoptimized_code_; // Unoptimized code, keep it after optimization.
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 8 && 1704 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 8 &&
1704 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 9 && 1705 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 9 &&
1705 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 10 && 1706 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 10 &&
1706 kStacktraceCid == kExternalInt8ArrayCid + 11); 1707 kStacktraceCid == kExternalInt8ArrayCid + 11);
1707 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); 1708 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid);
1708 } 1709 }
1709 1710
1710 } // namespace dart 1711 } // namespace dart
1711 1712
1712 #endif // VM_RAW_OBJECT_H_ 1713 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698