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

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

Issue 8440051: Intrinsify String.charCodeAt, String.length and String.hashCode. Improves frog performance by 2x. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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/intrinsifier_ia32.cc ('k') | runtime/vm/opt_code_generator_ia32.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "vm/assert.h" 8 #include "vm/assert.h"
9 #include "vm/dart.h" 9 #include "vm/dart.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 2481 matching lines...) Expand 10 before | Expand all | Expand 10 after
2492 HEAP_OBJECT_IMPLEMENTATION(String, Instance); 2492 HEAP_OBJECT_IMPLEMENTATION(String, Instance);
2493 }; 2493 };
2494 2494
2495 2495
2496 class OneByteString : public String { 2496 class OneByteString : public String {
2497 public: 2497 public:
2498 virtual int32_t CharAt(intptr_t index) const { 2498 virtual int32_t CharAt(intptr_t index) const {
2499 return *CharAddr(index); 2499 return *CharAddr(index);
2500 } 2500 }
2501 2501
2502 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); }
2503
2502 static intptr_t InstanceSize() { 2504 static intptr_t InstanceSize() {
2503 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); 2505 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_));
2504 return 0; 2506 return 0;
2505 } 2507 }
2506 2508
2507 static intptr_t InstanceSize(intptr_t len) { 2509 static intptr_t InstanceSize(intptr_t len) {
2508 return RoundedAllocationSize(sizeof(RawOneByteString) + len); 2510 return RoundedAllocationSize(sizeof(RawOneByteString) + len);
2509 } 2511 }
2510 2512
2511 static RawOneByteString* New(intptr_t len, 2513 static RawOneByteString* New(intptr_t len,
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
2987 } 2989 }
2988 2990
2989 2991
2990 void Context::SetAt(intptr_t index, const Instance& value) const { 2992 void Context::SetAt(intptr_t index, const Instance& value) const {
2991 StorePointer(InstanceAddr(index), value.raw()); 2993 StorePointer(InstanceAddr(index), value.raw());
2992 } 2994 }
2993 2995
2994 } // namespace dart 2996 } // namespace dart
2995 2997
2996 #endif // VM_OBJECT_H_ 2998 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/opt_code_generator_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698