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

Unified Diff: runtime/vm/object.cc

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, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 36916)
+++ runtime/vm/object.cc (working copy)
@@ -4927,12 +4927,12 @@
}
-void Function::set_code(const Code& value) const {
- StorePointer(&raw_ptr()->code_, value.raw());
+void Function::SetInstructions(const Code& value) const {
+ StorePointer(&raw_ptr()->instructions_, value.instructions());
}
void Function::AttachCode(const Code& value) const {
- set_code(value);
+ SetInstructions(value);
ASSERT(Function::Handle(value.function()).IsNull() ||
(value.function() == this->raw()));
value.set_owner(*this);
@@ -4940,14 +4940,16 @@
bool Function::HasCode() const {
- ASSERT(raw_ptr()->code_ != Code::null());
- return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code();
+ ASSERT(raw_ptr()->instructions_ != Instructions::null());
+ return raw_ptr()->instructions_ !=
+ StubCode::LazyCompile_entry()->code()->ptr()->instructions_;
}
void Function::ClearCode() const {
- StorePointer(&raw_ptr()->code_, StubCode::LazyCompile_entry()->code());
StorePointer(&raw_ptr()->unoptimized_code_, Code::null());
+ StorePointer(&raw_ptr()->instructions_,
+ Code::Handle(StubCode::LazyCompile_entry()->code()).instructions());
}
@@ -5976,7 +5978,7 @@
result.set_is_optimizable(is_native ? false : true);
result.set_is_inlinable(true);
result.set_allows_hoisting_check_class(true);
- result.set_code(Code::Handle(StubCode::LazyCompile_entry()->code()));
+ result.SetInstructions(Code::Handle(StubCode::LazyCompile_entry()->code()));
if (kind == RawFunction::kClosureFunction) {
const ClosureData& data = ClosureData::Handle(ClosureData::New());
result.set_data(data);
@@ -6301,7 +6303,8 @@
bool Function::HasOptimizedCode() const {
- return HasCode() && Code::Handle(raw_ptr()->code_).is_optimized();
+ return HasCode() && Code::Handle(Instructions::Handle(
+ raw_ptr()->instructions_).code()).is_optimized();
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698