| 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 "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 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 // Compute offsets of instance fields and instance size. | 1480 // Compute offsets of instance fields and instance size. |
| 1481 CalculateFieldOffsets(); | 1481 CalculateFieldOffsets(); |
| 1482 } | 1482 } |
| 1483 set_is_finalized(); | 1483 set_is_finalized(); |
| 1484 } | 1484 } |
| 1485 | 1485 |
| 1486 | 1486 |
| 1487 void Class::ApplyPatch(const Class& with) const { | 1487 void Class::ApplyPatch(const Class& with) const { |
| 1488 ASSERT(!is_finalized()); | 1488 ASSERT(!is_finalized()); |
| 1489 const Script& patch_script = Script::Handle(with.script()); | 1489 const Script& patch_script = Script::Handle(with.script()); |
| 1490 const String& str = String::Handle(patch_script.Source()); | |
| 1491 OS::PrintErr("patch_script: %s\n", str.ToCString()); | |
| 1492 const PatchClass& patch = PatchClass::Handle( | 1490 const PatchClass& patch = PatchClass::Handle( |
| 1493 PatchClass::New(*this, patch_script)); | 1491 PatchClass::New(*this, patch_script)); |
| 1494 | 1492 |
| 1495 const Array& orig_functions = Array::Handle(functions()); | 1493 const Array& orig_functions = Array::Handle(functions()); |
| 1496 intptr_t orig_len = orig_functions.Length(); | 1494 intptr_t orig_len = orig_functions.Length(); |
| 1497 | 1495 |
| 1498 const Array& patch_functions = Array::Handle(with.functions()); | 1496 const Array& patch_functions = Array::Handle(with.functions()); |
| 1499 intptr_t patch_len = patch_functions.Length(); | 1497 intptr_t patch_len = patch_functions.Length(); |
| 1500 | 1498 |
| 1501 // TODO(iposva): Verify that only patching existing methods and adding only | 1499 // TODO(iposva): Verify that only patching existing methods and adding only |
| (...skipping 9687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11189 const char* JSRegExp::ToCString() const { | 11187 const char* JSRegExp::ToCString() const { |
| 11190 const String& str = String::Handle(pattern()); | 11188 const String& str = String::Handle(pattern()); |
| 11191 const char* format = "JSRegExp: pattern=%s flags=%s"; | 11189 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 11192 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 11190 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 11193 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1); | 11191 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1); |
| 11194 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 11192 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 11195 return chars; | 11193 return chars; |
| 11196 } | 11194 } |
| 11197 | 11195 |
| 11198 } // namespace dart | 11196 } // namespace dart |
| OLD | NEW |