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

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: Also use the native parse directly in JSON parsing. 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 2733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 return raw() == CoreLibrary(); 2744 return raw() == CoreLibrary();
2745 } 2745 }
2746 2746
2747 static RawLibrary* LookupLibrary(const String& url); 2747 static RawLibrary* LookupLibrary(const String& url);
2748 static RawLibrary* GetLibrary(intptr_t index); 2748 static RawLibrary* GetLibrary(intptr_t index);
2749 2749
2750 static void InitCoreLibrary(Isolate* isolate); 2750 static void InitCoreLibrary(Isolate* isolate);
2751 static void InitNativeWrappersLibrary(Isolate* isolate); 2751 static void InitNativeWrappersLibrary(Isolate* isolate);
2752 2752
2753 static RawLibrary* AsyncLibrary(); 2753 static RawLibrary* AsyncLibrary();
2754 static RawLibrary* ConvertLibrary();
2754 static RawLibrary* CoreLibrary(); 2755 static RawLibrary* CoreLibrary();
2755 static RawLibrary* CollectionLibrary(); 2756 static RawLibrary* CollectionLibrary();
2756 static RawLibrary* InternalLibrary(); 2757 static RawLibrary* InternalLibrary();
2757 static RawLibrary* IsolateLibrary(); 2758 static RawLibrary* IsolateLibrary();
2758 static RawLibrary* MathLibrary(); 2759 static RawLibrary* MathLibrary();
2759 static RawLibrary* MirrorsLibrary(); 2760 static RawLibrary* MirrorsLibrary();
2760 static RawLibrary* NativeWrappersLibrary(); 2761 static RawLibrary* NativeWrappersLibrary();
2761 static RawLibrary* TypedDataLibrary(); 2762 static RawLibrary* TypedDataLibrary();
2762 static RawLibrary* ProfilerLibrary(); 2763 static RawLibrary* ProfilerLibrary();
2763 2764
(...skipping 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after
5488 static RawString* IdentifierPrettyName(const String& name); 5489 static RawString* IdentifierPrettyName(const String& name);
5489 static RawString* IdentifierPrettyNameRetainPrivate(const String& name); 5490 static RawString* IdentifierPrettyNameRetainPrivate(const String& name);
5490 5491
5491 static bool EqualsIgnoringPrivateKey(const String& str1, 5492 static bool EqualsIgnoringPrivateKey(const String& str1,
5492 const String& str2); 5493 const String& str2);
5493 5494
5494 static RawString* NewFormatted(const char* format, ...) 5495 static RawString* NewFormatted(const char* format, ...)
5495 PRINTF_ATTRIBUTE(1, 2); 5496 PRINTF_ATTRIBUTE(1, 2);
5496 static RawString* NewFormattedV(const char* format, va_list args); 5497 static RawString* NewFormattedV(const char* format, va_list args);
5497 5498
5499 static bool ParseDouble(const String& str,
5500 intptr_t start,
5501 intptr_t end,
5502 double* result);
5503
5498 protected: 5504 protected:
5499 bool HasHash() const { 5505 bool HasHash() const {
5500 ASSERT(Smi::New(0) == NULL); 5506 ASSERT(Smi::New(0) == NULL);
5501 return (raw_ptr()->hash_ != NULL); 5507 return (raw_ptr()->hash_ != NULL);
5502 } 5508 }
5503 5509
5504 void SetLength(intptr_t value) const { 5510 void SetLength(intptr_t value) const {
5505 // This is only safe because we create a new Smi, which does not cause 5511 // This is only safe because we create a new Smi, which does not cause
5506 // heap allocation. 5512 // heap allocation.
5507 raw_ptr()->length_ = Smi::New(value); 5513 raw_ptr()->length_ = Smi::New(value);
(...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
7137 7143
7138 7144
7139 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7145 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7140 intptr_t index) { 7146 intptr_t index) {
7141 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7147 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7142 } 7148 }
7143 7149
7144 } // namespace dart 7150 } // namespace dart
7145 7151
7146 #endif // VM_OBJECT_H_ 7152 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698