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

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

Issue 324843004: Significantly improve performance of code coverage tool by precomputing a map token_pos->line numbe… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 2454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2465 }; 2465 };
2466 2466
2467 2467
2468 class Script : public Object { 2468 class Script : public Object {
2469 public: 2469 public:
2470 RawString* url() const { return raw_ptr()->url_; } 2470 RawString* url() const { return raw_ptr()->url_; }
2471 bool HasSource() const; 2471 bool HasSource() const;
2472 RawString* Source() const; 2472 RawString* Source() const;
2473 RawString* GenerateSource() const; // Generates source code from Tokenstream. 2473 RawString* GenerateSource() const; // Generates source code from Tokenstream.
2474 RawGrowableObjectArray* GenerateLineNumberArray() const; 2474 RawGrowableObjectArray* GenerateLineNumberArray() const;
2475 void ComputeTokenPosToLineNumberArray() const;
2475 RawScript::Kind kind() const { 2476 RawScript::Kind kind() const {
2476 return static_cast<RawScript::Kind>(raw_ptr()->kind_); 2477 return static_cast<RawScript::Kind>(raw_ptr()->kind_);
2477 } 2478 }
2478 const char* GetKindAsCString() const; 2479 const char* GetKindAsCString() const;
2479 intptr_t line_offset() const { return raw_ptr()->line_offset_; } 2480 intptr_t line_offset() const { return raw_ptr()->line_offset_; }
2480 intptr_t col_offset() const { return raw_ptr()->col_offset_; } 2481 intptr_t col_offset() const { return raw_ptr()->col_offset_; }
2481 2482
2482 RawTokenStream* tokens() const { return raw_ptr()->tokens_; } 2483 RawTokenStream* tokens() const { return raw_ptr()->tokens_; }
2483 2484
2484 void Tokenize(const String& private_key) const; 2485 void Tokenize(const String& private_key) const;
(...skipping 25 matching lines...) Expand all
2510 2511
2511 static RawScript* New(const String& url, 2512 static RawScript* New(const String& url,
2512 const String& source, 2513 const String& source,
2513 RawScript::Kind kind); 2514 RawScript::Kind kind);
2514 2515
2515 private: 2516 private:
2516 void set_url(const String& value) const; 2517 void set_url(const String& value) const;
2517 void set_source(const String& value) const; 2518 void set_source(const String& value) const;
2518 void set_kind(RawScript::Kind value) const; 2519 void set_kind(RawScript::Kind value) const;
2519 void set_tokens(const TokenStream& value) const; 2520 void set_tokens(const TokenStream& value) const;
2521 void set_token_pos_to_line_nr(const TypedData& value) const;
2522 RawTypedData* token_pos_to_line_nr() const;
2520 2523
2521 static RawScript* New(); 2524 static RawScript* New();
2522 2525
2523 FINAL_HEAP_OBJECT_IMPLEMENTATION(Script, Object); 2526 FINAL_HEAP_OBJECT_IMPLEMENTATION(Script, Object);
2524 friend class Class; 2527 friend class Class;
2525 }; 2528 };
2526 2529
2527 2530
2528 class DictionaryIterator : public ValueObject { 2531 class DictionaryIterator : public ValueObject {
2529 public: 2532 public:
(...skipping 4578 matching lines...) Expand 10 before | Expand all | Expand 10 after
7108 7111
7109 7112
7110 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7113 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7111 intptr_t index) { 7114 intptr_t index) {
7112 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7115 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7113 } 7116 }
7114 7117
7115 } // namespace dart 7118 } // namespace dart
7116 7119
7117 #endif // VM_OBJECT_H_ 7120 #endif // VM_OBJECT_H_
OLDNEW
« runtime/vm/coverage.cc ('K') | « runtime/vm/coverage.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698