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

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

Issue 311963002: In class Function replace current code field with current instruction field, that way we save one l… (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
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/object.cc » ('j') | 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 #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 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 1569
1570 // Parameter names are valid for all valid parameter indices, and are not 1570 // Parameter names are valid for all valid parameter indices, and are not
1571 // limited to named optional parameters. 1571 // limited to named optional parameters.
1572 RawString* ParameterNameAt(intptr_t index) const; 1572 RawString* ParameterNameAt(intptr_t index) const;
1573 void SetParameterNameAt(intptr_t index, const String& value) const; 1573 void SetParameterNameAt(intptr_t index, const String& value) const;
1574 RawArray* parameter_names() const { return raw_ptr()->parameter_names_; } 1574 RawArray* parameter_names() const { return raw_ptr()->parameter_names_; }
1575 void set_parameter_names(const Array& value) const; 1575 void set_parameter_names(const Array& value) const;
1576 1576
1577 // Sets function's code and code's function. 1577 // Sets function's code and code's function.
1578 void AttachCode(const Code& value) const; 1578 void AttachCode(const Code& value) const;
1579 void set_code(const Code& value) const; 1579 void SetInstructions(const Code& value) const;
1580 void ClearCode() const; 1580 void ClearCode() const;
1581 1581
1582 // Disables optimized code and switches to unoptimized code. 1582 // Disables optimized code and switches to unoptimized code.
1583 void SwitchToUnoptimizedCode() const; 1583 void SwitchToUnoptimizedCode() const;
1584 1584
1585 // Return the most recently compiled and installed code for this function. 1585 // Return the most recently compiled and installed code for this function.
1586 // It is not the only Code object that points to this function. 1586 // It is not the only Code object that points to this function.
1587 RawCode* CurrentCode() const { return raw_ptr()->code_; } 1587 RawCode* CurrentCode() const {
1588 return raw_ptr()->instructions_->ptr()->code_;
1589 }
1588 1590
1589 RawCode* unoptimized_code() const { return raw_ptr()->unoptimized_code_; } 1591 RawCode* unoptimized_code() const { return raw_ptr()->unoptimized_code_; }
1590 void set_unoptimized_code(const Code& value) const; 1592 void set_unoptimized_code(const Code& value) const;
1591 static intptr_t code_offset() { return OFFSET_OF(RawFunction, code_); }
1592 static intptr_t unoptimized_code_offset() { 1593 static intptr_t unoptimized_code_offset() {
1593 return OFFSET_OF(RawFunction, unoptimized_code_); 1594 return OFFSET_OF(RawFunction, unoptimized_code_);
1594 } 1595 }
1595 bool HasCode() const; 1596 bool HasCode() const;
1596 1597
1598 static intptr_t instructions_offset() {
1599 return OFFSET_OF(RawFunction, instructions_);
1600 }
1601
1597 // Returns true if there is at least one debugger breakpoint 1602 // Returns true if there is at least one debugger breakpoint
1598 // set in this function. 1603 // set in this function.
1599 bool HasBreakpoint() const; 1604 bool HasBreakpoint() const;
1600 1605
1601 RawContextScope* context_scope() const; 1606 RawContextScope* context_scope() const;
1602 void set_context_scope(const ContextScope& value) const; 1607 void set_context_scope(const ContextScope& value) const;
1603 1608
1604 // Enclosing function of this local function. 1609 // Enclosing function of this local function.
1605 RawFunction* parent_function() const; 1610 RawFunction* parent_function() const;
1606 1611
(...skipping 5467 matching lines...) Expand 10 before | Expand all | Expand 10 after
7074 7079
7075 7080
7076 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7081 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7077 intptr_t index) { 7082 intptr_t index) {
7078 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7083 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7079 } 7084 }
7080 7085
7081 } // namespace dart 7086 } // namespace dart
7082 7087
7083 #endif // VM_OBJECT_H_ 7088 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698