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

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

Issue 12335138: Intrinsify OnebyteString's hashcode. Next step is to inline it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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/intrinsifier_x64.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 (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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 10451 matching lines...) Expand 10 before | Expand all | Expand 10 after
10462 Zone* zone = Isolate::Current()->current_zone(); 10462 Zone* zone = Isolate::Current()->current_zone();
10463 return zone->AllocUnsafe(size); 10463 return zone->AllocUnsafe(size);
10464 } 10464 }
10465 10465
10466 10466
10467 const char* Bigint::ToCString() const { 10467 const char* Bigint::ToCString() const {
10468 return BigintOperations::ToDecimalCString(*this, &BigintAllocator); 10468 return BigintOperations::ToDecimalCString(*this, &BigintAllocator);
10469 } 10469 }
10470 10470
10471 10471
10472 // Synchronize with implementation in compiler (intrinsifier).
10472 class StringHasher : ValueObject { 10473 class StringHasher : ValueObject {
10473 public: 10474 public:
10474 StringHasher() : hash_(0) {} 10475 StringHasher() : hash_(0) {}
10475 void Add(int32_t ch) { 10476 void Add(int32_t ch) {
10476 hash_ += ch; 10477 hash_ += ch;
10477 hash_ += hash_ << 10; 10478 hash_ += hash_ << 10;
10478 hash_ ^= hash_ >> 6; 10479 hash_ ^= hash_ >> 6;
10479 } 10480 }
10480 // Return a non-zero hash of at most 'bits' bits. 10481 // Return a non-zero hash of at most 'bits' bits.
10481 intptr_t Finalize(int bits) { 10482 intptr_t Finalize(int bits) {
(...skipping 2624 matching lines...) Expand 10 before | Expand all | Expand 10 after
13106 } 13107 }
13107 return result.raw(); 13108 return result.raw();
13108 } 13109 }
13109 13110
13110 13111
13111 const char* WeakProperty::ToCString() const { 13112 const char* WeakProperty::ToCString() const {
13112 return "_WeakProperty"; 13113 return "_WeakProperty";
13113 } 13114 }
13114 13115
13115 } // namespace dart 13116 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698