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

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

Issue 296003013: - Reduce the number of Isolate::Current() calls. (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 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 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 11589 matching lines...) Expand 10 before | Expand all | Expand 10 after
11600 // Set object pool in Instructions object. 11600 // Set object pool in Instructions object.
11601 const GrowableObjectArray& object_pool = assembler->object_pool(); 11601 const GrowableObjectArray& object_pool = assembler->object_pool();
11602 if (object_pool.IsNull()) { 11602 if (object_pool.IsNull()) {
11603 instrs.set_object_pool(Object::empty_array().raw()); 11603 instrs.set_object_pool(Object::empty_array().raw());
11604 } else { 11604 } else {
11605 // TODO(regis): Once MakeArray takes a Heap::Space argument, call it here 11605 // TODO(regis): Once MakeArray takes a Heap::Space argument, call it here
11606 // with Heap::kOld and change the ARM and MIPS assemblers to work with a 11606 // with Heap::kOld and change the ARM and MIPS assemblers to work with a
11607 // GrowableObjectArray in new space. 11607 // GrowableObjectArray in new space.
11608 instrs.set_object_pool(Array::MakeArray(object_pool)); 11608 instrs.set_object_pool(Array::MakeArray(object_pool));
11609 } 11609 }
11610 bool status = 11610 if (FLAG_write_protect_code) {
11611 VirtualMemory::Protect(reinterpret_cast<void*>(instrs.raw_ptr()), 11611 bool status = VirtualMemory::Protect(
11612 instrs.raw()->Size(), 11612 reinterpret_cast<void*>(instrs.raw_ptr()), instrs.raw()->Size(),
11613 FLAG_write_protect_code 11613 VirtualMemory::kReadExecute);
11614 ? VirtualMemory::kReadExecute 11614 ASSERT(status);
11615 : VirtualMemory::kReadWriteExecute); 11615 }
11616 ASSERT(status);
11617 } 11616 }
11618 code.set_comments(assembler->GetCodeComments()); 11617 code.set_comments(assembler->GetCodeComments());
11619 return code.raw(); 11618 return code.raw();
11620 } 11619 }
11621 11620
11622 11621
11623 RawCode* Code::FinalizeCode(const Function& function, 11622 RawCode* Code::FinalizeCode(const Function& function,
11624 Assembler* assembler, 11623 Assembler* assembler,
11625 bool optimized) { 11624 bool optimized) {
11626 // Calling ToFullyQualifiedCString is very expensive, try to avoid it. 11625 // Calling ToFullyQualifiedCString is very expensive, try to avoid it.
(...skipping 7229 matching lines...) Expand 10 before | Expand all | Expand 10 after
18856 return tag_label.ToCString(); 18855 return tag_label.ToCString();
18857 } 18856 }
18858 18857
18859 18858
18860 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 18859 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
18861 Instance::PrintJSONImpl(stream, ref); 18860 Instance::PrintJSONImpl(stream, ref);
18862 } 18861 }
18863 18862
18864 18863
18865 } // namespace dart 18864 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698