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

Side by Side Diff: vm/object.cc

Issue 11519006: Add read only handles for the following predefined symbols (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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
« vm/ast.h ('K') | « vm/object.h ('k') | vm/parser.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 #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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 isolate()->store_buffer()->AddPointer(ptr); 1243 isolate()->store_buffer()->AddPointer(ptr);
1244 } 1244 }
1245 } 1245 }
1246 } 1246 }
1247 1247
1248 private: 1248 private:
1249 DISALLOW_COPY_AND_ASSIGN(StoreBufferObjectPointerVisitor); 1249 DISALLOW_COPY_AND_ASSIGN(StoreBufferObjectPointerVisitor);
1250 }; 1250 };
1251 1251
1252 1252
1253 bool Object::IsPredefinedHandle() const {
1254 return Symbols::IsPredefinedHandle(reinterpret_cast<uword>(this));
1255 }
1256
1257
1253 RawObject* Object::Clone(const Object& src, Heap::Space space) { 1258 RawObject* Object::Clone(const Object& src, Heap::Space space) {
1254 const Class& cls = Class::Handle(src.clazz()); 1259 const Class& cls = Class::Handle(src.clazz());
1255 intptr_t size = src.raw()->Size(); 1260 intptr_t size = src.raw()->Size();
1256 RawObject* raw_obj = Object::Allocate(cls.id(), size, space); 1261 RawObject* raw_obj = Object::Allocate(cls.id(), size, space);
1257 NoGCScope no_gc; 1262 NoGCScope no_gc;
1258 memmove(raw_obj->ptr(), src.raw()->ptr(), size); 1263 memmove(raw_obj->ptr(), src.raw()->ptr(), size);
1259 if (space == Heap::kOld) { 1264 if (space == Heap::kOld) {
1260 StoreBufferObjectPointerVisitor visitor(Isolate::Current()); 1265 StoreBufferObjectPointerVisitor visitor(Isolate::Current());
1261 raw_obj->VisitPointers(&visitor); 1266 raw_obj->VisitPointers(&visitor);
1262 } 1267 }
(...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after
3388 } 3393 }
3389 3394
3390 3395
3391 void Function::set_is_inlinable(bool value) const { 3396 void Function::set_is_inlinable(bool value) const {
3392 set_kind_tag(InlinableBit::update(value, raw_ptr()->kind_tag_)); 3397 set_kind_tag(InlinableBit::update(value, raw_ptr()->kind_tag_));
3393 } 3398 }
3394 3399
3395 3400
3396 bool Function::IsInlineable() const { 3401 bool Function::IsInlineable() const {
3397 // '==' call is handled specially. 3402 // '==' call is handled specially.
3398 const String& equality_name = String::Handle(Symbols::EqualOperator());
3399 return InlinableBit::decode(raw_ptr()->kind_tag_) && 3403 return InlinableBit::decode(raw_ptr()->kind_tag_) &&
3400 HasCode() && 3404 HasCode() &&
3401 name() != equality_name.raw(); 3405 name() != Symbols::EqualOperator();
3402 } 3406 }
3403 3407
3404 3408
3405 intptr_t Function::NumParameters() const { 3409 intptr_t Function::NumParameters() const {
3406 return num_fixed_parameters() + NumOptionalParameters(); 3410 return num_fixed_parameters() + NumOptionalParameters();
3407 } 3411 }
3408 3412
3409 3413
3410 intptr_t Function::NumImplicitParameters() const { 3414 intptr_t Function::NumImplicitParameters() const {
3411 if (kind() == RawFunction::kConstructor) { 3415 if (kind() == RawFunction::kConstructor) {
(...skipping 8887 matching lines...) Expand 10 before | Expand all | Expand 10 after
12299 } 12303 }
12300 return result.raw(); 12304 return result.raw();
12301 } 12305 }
12302 12306
12303 12307
12304 const char* WeakProperty::ToCString() const { 12308 const char* WeakProperty::ToCString() const {
12305 return "_WeakProperty"; 12309 return "_WeakProperty";
12306 } 12310 }
12307 12311
12308 } // namespace dart 12312 } // namespace dart
OLDNEW
« vm/ast.h ('K') | « vm/object.h ('k') | vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698