| OLD | NEW |
| 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 "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 5474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5485 | 5485 |
| 5486 RawInstructions* Instructions::New(intptr_t size) { | 5486 RawInstructions* Instructions::New(intptr_t size) { |
| 5487 const Class& instructions_class = Class::Handle(Object::instructions_class()); | 5487 const Class& instructions_class = Class::Handle(Object::instructions_class()); |
| 5488 Instructions& result = Instructions::Handle(); | 5488 Instructions& result = Instructions::Handle(); |
| 5489 { | 5489 { |
| 5490 uword aligned_size = Instructions::InstanceSize(size); | 5490 uword aligned_size = Instructions::InstanceSize(size); |
| 5491 RawObject* raw = Object::Allocate(instructions_class, | 5491 RawObject* raw = Object::Allocate(instructions_class, |
| 5492 aligned_size, | 5492 aligned_size, |
| 5493 Heap::kExecutable); | 5493 Heap::kExecutable); |
| 5494 NoGCScope no_gc; | 5494 NoGCScope no_gc; |
| 5495 // TODO(iposva): Remove premarking once old and code spaces are merged. |
| 5496 raw->SetMarkBit(); |
| 5495 result ^= raw; | 5497 result ^= raw; |
| 5496 result.set_size(size); | 5498 result.set_size(size); |
| 5497 } | 5499 } |
| 5498 return result.raw(); | 5500 return result.raw(); |
| 5499 } | 5501 } |
| 5500 | 5502 |
| 5501 | 5503 |
| 5502 const char* Instructions::ToCString() const { | 5504 const char* Instructions::ToCString() const { |
| 5503 return "Instructions"; | 5505 return "Instructions"; |
| 5504 } | 5506 } |
| (...skipping 3732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9237 const String& str = String::Handle(pattern()); | 9239 const String& str = String::Handle(pattern()); |
| 9238 const char* format = "JSRegExp: pattern=%s flags=%s"; | 9240 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 9239 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 9241 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 9240 char* chars = reinterpret_cast<char*>( | 9242 char* chars = reinterpret_cast<char*>( |
| 9241 Isolate::Current()->current_zone()->Allocate(len + 1)); | 9243 Isolate::Current()->current_zone()->Allocate(len + 1)); |
| 9242 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 9244 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 9243 return chars; | 9245 return chars; |
| 9244 } | 9246 } |
| 9245 | 9247 |
| 9246 } // namespace dart | 9248 } // namespace dart |
| OLD | NEW |