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

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

Issue 10880020: Use patching for regexp implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Real VM fix from Ivan. Created 8 years, 4 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
« no previous file with comments | « runtime/lib/regexp_patch.dart ('k') | no next file » | 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 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 const GrowableObjectArray& new_functions = GrowableObjectArray::Handle( 1593 const GrowableObjectArray& new_functions = GrowableObjectArray::Handle(
1594 GrowableObjectArray::New(orig_len)); 1594 GrowableObjectArray::New(orig_len));
1595 for (intptr_t i = 0; i < orig_len; i++) { 1595 for (intptr_t i = 0; i < orig_len; i++) {
1596 orig_func ^= orig_list.At(i); 1596 orig_func ^= orig_list.At(i);
1597 member_name = orig_func.name(); 1597 member_name = orig_func.name();
1598 func = patch.LookupFunction(member_name); 1598 func = patch.LookupFunction(member_name);
1599 if (func.IsNull()) { 1599 if (func.IsNull()) {
1600 // Non-patched function is preserved, all patched functions are added in 1600 // Non-patched function is preserved, all patched functions are added in
1601 // the loop below. 1601 // the loop below.
1602 new_functions.Add(orig_func); 1602 new_functions.Add(orig_func);
1603 } else if (!func.HasCompatibleParametersWith(orig_func)) { 1603 } else if (!func.HasCompatibleParametersWith(orig_func) &&
1604 !(func.IsFactory() && orig_func.IsConstructor() &&
1605 (func.num_fixed_parameters() + 1 ==
1606 orig_func.num_fixed_parameters()))) {
1604 return FormatPatchError("mismatched parameters: %s", member_name); 1607 return FormatPatchError("mismatched parameters: %s", member_name);
1605 } 1608 }
1606 } 1609 }
1607 for (intptr_t i = 0; i < patch_len; i++) { 1610 for (intptr_t i = 0; i < patch_len; i++) {
1608 func ^= patch_list.At(i); 1611 func ^= patch_list.At(i);
1609 func.set_owner(patch_class); 1612 func.set_owner(patch_class);
1610 new_functions.Add(func); 1613 new_functions.Add(func);
1611 } 1614 }
1612 Array& new_list = Array::Handle(Array::MakeArray(new_functions)); 1615 Array& new_list = Array::Handle(Array::MakeArray(new_functions));
1613 SetFunctions(new_list); 1616 SetFunctions(new_list);
(...skipping 9540 matching lines...) Expand 10 before | Expand all | Expand 10 after
11154 } 11157 }
11155 return result.raw(); 11158 return result.raw();
11156 } 11159 }
11157 11160
11158 11161
11159 const char* WeakProperty::ToCString() const { 11162 const char* WeakProperty::ToCString() const {
11160 return "_WeakProperty"; 11163 return "_WeakProperty";
11161 } 11164 }
11162 11165
11163 } // namespace dart 11166 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/regexp_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698