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

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

Issue 368483004: Avoid unnecessary copying when parsing doubles. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 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 | Annotate | Revision Log
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_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include <limits> 8 #include <limits>
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 5477 matching lines...) Expand 10 before | Expand all | Expand 10 after
5488 static RawString* IdentifierPrettyName(const String& name); 5488 static RawString* IdentifierPrettyName(const String& name);
5489 static RawString* IdentifierPrettyNameRetainPrivate(const String& name); 5489 static RawString* IdentifierPrettyNameRetainPrivate(const String& name);
5490 5490
5491 static bool EqualsIgnoringPrivateKey(const String& str1, 5491 static bool EqualsIgnoringPrivateKey(const String& str1,
5492 const String& str2); 5492 const String& str2);
5493 5493
5494 static RawString* NewFormatted(const char* format, ...) 5494 static RawString* NewFormatted(const char* format, ...)
5495 PRINTF_ATTRIBUTE(1, 2); 5495 PRINTF_ATTRIBUTE(1, 2);
5496 static RawString* NewFormattedV(const char* format, va_list args); 5496 static RawString* NewFormattedV(const char* format, va_list args);
5497 5497
5498 static bool ParseDouble(const String& str,
5499 intptr_t start,
5500 intptr_t end,
5501 double* result);
5502
5498 protected: 5503 protected:
5499 bool HasHash() const { 5504 bool HasHash() const {
5500 ASSERT(Smi::New(0) == NULL); 5505 ASSERT(Smi::New(0) == NULL);
5501 return (raw_ptr()->hash_ != NULL); 5506 return (raw_ptr()->hash_ != NULL);
5502 } 5507 }
5503 5508
5504 void SetLength(intptr_t value) const { 5509 void SetLength(intptr_t value) const {
5505 // This is only safe because we create a new Smi, which does not cause 5510 // This is only safe because we create a new Smi, which does not cause
5506 // heap allocation. 5511 // heap allocation.
5507 raw_ptr()->length_ = Smi::New(value); 5512 raw_ptr()->length_ = Smi::New(value);
(...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
7137 7142
7138 7143
7139 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7144 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7140 intptr_t index) { 7145 intptr_t index) {
7141 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7146 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7142 } 7147 }
7143 7148
7144 } // namespace dart 7149 } // namespace dart
7145 7150
7146 #endif // VM_OBJECT_H_ 7151 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698