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

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

Issue 2126393003: Cache compile-time constants on the script object, sometimes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: cleanups Created 4 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
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 3459 matching lines...) Expand 10 before | Expand all | Expand 10 after
3470 RawScript::Kind kind() const { 3470 RawScript::Kind kind() const {
3471 return static_cast<RawScript::Kind>(raw_ptr()->kind_); 3471 return static_cast<RawScript::Kind>(raw_ptr()->kind_);
3472 } 3472 }
3473 const char* GetKindAsCString() const; 3473 const char* GetKindAsCString() const;
3474 intptr_t line_offset() const { return raw_ptr()->line_offset_; } 3474 intptr_t line_offset() const { return raw_ptr()->line_offset_; }
3475 intptr_t col_offset() const { return raw_ptr()->col_offset_; } 3475 intptr_t col_offset() const { return raw_ptr()->col_offset_; }
3476 3476
3477 // The load time in milliseconds since epoch. 3477 // The load time in milliseconds since epoch.
3478 int64_t load_timestamp() const { return raw_ptr()->load_timestamp_; } 3478 int64_t load_timestamp() const { return raw_ptr()->load_timestamp_; }
3479 3479
3480 RawArray* compile_time_constants() const {
3481 return raw_ptr()->compile_time_constants_;
3482 }
3483 void set_compile_time_constants(const Array& value) const;
3484
3480 RawTokenStream* tokens() const { return raw_ptr()->tokens_; } 3485 RawTokenStream* tokens() const { return raw_ptr()->tokens_; }
3481 3486
3482 void Tokenize(const String& private_key, 3487 void Tokenize(const String& private_key,
3483 bool use_shared_tokens = true) const; 3488 bool use_shared_tokens = true) const;
3484 3489
3485 RawLibrary* FindLibrary() const; 3490 RawLibrary* FindLibrary() const;
3486 RawString* GetLine(intptr_t line_number, 3491 RawString* GetLine(intptr_t line_number,
3487 Heap::Space space = Heap::kNew) const; 3492 Heap::Space space = Heap::kNew) const;
3488 RawString* GetSnippet(intptr_t from_line, 3493 RawString* GetSnippet(intptr_t from_line,
3489 intptr_t from_column, 3494 intptr_t from_column,
(...skipping 5241 matching lines...) Expand 10 before | Expand all | Expand 10 after
8731 8736
8732 inline void TypeArguments::SetHash(intptr_t value) const { 8737 inline void TypeArguments::SetHash(intptr_t value) const {
8733 // This is only safe because we create a new Smi, which does not cause 8738 // This is only safe because we create a new Smi, which does not cause
8734 // heap allocation. 8739 // heap allocation.
8735 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8740 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8736 } 8741 }
8737 8742
8738 } // namespace dart 8743 } // namespace dart
8739 8744
8740 #endif // VM_OBJECT_H_ 8745 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698