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

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

Issue 1130753006: Hide Isolate pointer from embedder (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 20097 matching lines...) Expand 10 before | Expand all | Expand 10 after
20108 20108
20109 20109
20110 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { 20110 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const {
20111 Instance::PrintJSONImpl(stream, ref); 20111 Instance::PrintJSONImpl(stream, ref);
20112 } 20112 }
20113 20113
20114 20114
20115 RawReceivePort* ReceivePort::New(Dart_Port id, 20115 RawReceivePort* ReceivePort::New(Dart_Port id,
20116 bool is_control_port, 20116 bool is_control_port,
20117 Heap::Space space) { 20117 Heap::Space space) {
20118 ASSERT(id != ILLEGAL_PORT); 20118 ASSERT(id != DART_ILLEGAL_PORT);
20119 Isolate* isolate = Isolate::Current(); 20119 Isolate* isolate = Isolate::Current();
20120 const SendPort& send_port = 20120 const SendPort& send_port =
20121 SendPort::Handle(isolate, SendPort::New(id, isolate->origin_id())); 20121 SendPort::Handle(isolate, SendPort::New(id, isolate->origin_id()));
20122 20122
20123 ReceivePort& result = ReceivePort::Handle(isolate); 20123 ReceivePort& result = ReceivePort::Handle(isolate);
20124 { 20124 {
20125 RawObject* raw = Object::Allocate(ReceivePort::kClassId, 20125 RawObject* raw = Object::Allocate(ReceivePort::kClassId,
20126 ReceivePort::InstanceSize(), 20126 ReceivePort::InstanceSize(),
20127 space); 20127 space);
20128 NoSafepointScope no_safepoint; 20128 NoSafepointScope no_safepoint;
(...skipping 20 matching lines...) Expand all
20149 20149
20150 20150
20151 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) { 20151 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) {
20152 return New(id, Isolate::Current()->origin_id(), space); 20152 return New(id, Isolate::Current()->origin_id(), space);
20153 } 20153 }
20154 20154
20155 20155
20156 RawSendPort* SendPort::New(Dart_Port id, 20156 RawSendPort* SendPort::New(Dart_Port id,
20157 Dart_Port origin_id, 20157 Dart_Port origin_id,
20158 Heap::Space space) { 20158 Heap::Space space) {
20159 ASSERT(id != ILLEGAL_PORT); 20159 ASSERT(id != DART_ILLEGAL_PORT);
20160 SendPort& result = SendPort::Handle(); 20160 SendPort& result = SendPort::Handle();
20161 { 20161 {
20162 RawObject* raw = Object::Allocate(SendPort::kClassId, 20162 RawObject* raw = Object::Allocate(SendPort::kClassId,
20163 SendPort::InstanceSize(), 20163 SendPort::InstanceSize(),
20164 space); 20164 space);
20165 NoSafepointScope no_safepoint; 20165 NoSafepointScope no_safepoint;
20166 result ^= raw; 20166 result ^= raw;
20167 result.StoreNonPointer(&result.raw_ptr()->id_, id); 20167 result.StoreNonPointer(&result.raw_ptr()->id_, id);
20168 result.StoreNonPointer(&result.raw_ptr()->origin_id_, origin_id); 20168 result.StoreNonPointer(&result.raw_ptr()->origin_id_, origin_id);
20169 } 20169 }
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
20759 return tag_label.ToCString(); 20759 return tag_label.ToCString();
20760 } 20760 }
20761 20761
20762 20762
20763 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20763 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20764 Instance::PrintJSONImpl(stream, ref); 20764 Instance::PrintJSONImpl(stream, ref);
20765 } 20765 }
20766 20766
20767 20767
20768 } // namespace dart 20768 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698