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

Side by Side Diff: src/runtime.cc

Issue 165449: Avoid map transitions and multiple backing arrays for builtin prototypes... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 | « src/runtime.h ('k') | src/spaces.h » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 ASSERT(Top::has_pending_exception()); 1015 ASSERT(Top::has_pending_exception());
1016 return Failure::Exception(); 1016 return Failure::Exception();
1017 } 1017 }
1018 } 1018 }
1019 } 1019 }
1020 1020
1021 return *value; 1021 return *value;
1022 } 1022 }
1023 1023
1024 1024
1025 static Object* Runtime_OptimizeObjectForAddingMultipleProperties(
1026 Arguments args) {
1027 HandleScope scope;
1028 ASSERT(args.length() == 2);
1029 CONVERT_ARG_CHECKED(JSObject, object, 0);
1030 CONVERT_SMI_CHECKED(properties, args[1]);
1031 if (object->HasFastProperties()) {
1032 NormalizeProperties(object, KEEP_INOBJECT_PROPERTIES, properties);
1033 }
1034 return *object;
1035 }
1036
1037
1038 static Object* Runtime_TransformToFastProperties(Arguments args) {
1039 HandleScope scope;
1040 ASSERT(args.length() == 1);
1041 CONVERT_ARG_CHECKED(JSObject, object, 0);
1042 if (!object->HasFastProperties() && !object->IsGlobalObject()) {
1043 TransformToFastProperties(object, 0);
1044 }
1045 return *object;
1046 }
1047
1048
1025 static Object* Runtime_RegExpExec(Arguments args) { 1049 static Object* Runtime_RegExpExec(Arguments args) {
1026 HandleScope scope; 1050 HandleScope scope;
1027 ASSERT(args.length() == 4); 1051 ASSERT(args.length() == 4);
1028 CONVERT_ARG_CHECKED(JSRegExp, regexp, 0); 1052 CONVERT_ARG_CHECKED(JSRegExp, regexp, 0);
1029 CONVERT_ARG_CHECKED(String, subject, 1); 1053 CONVERT_ARG_CHECKED(String, subject, 1);
1030 // Due to the way the JS calls are constructed this must be less than the 1054 // Due to the way the JS calls are constructed this must be less than the
1031 // length of a string, i.e. it is always a Smi. We check anyway for security. 1055 // length of a string, i.e. it is always a Smi. We check anyway for security.
1032 CONVERT_SMI_CHECKED(index, args[2]); 1056 CONVERT_SMI_CHECKED(index, args[2]);
1033 CONVERT_ARG_CHECKED(JSArray, last_match_info, 3); 1057 CONVERT_ARG_CHECKED(JSArray, last_match_info, 3);
1034 RUNTIME_ASSERT(last_match_info->HasFastElements()); 1058 RUNTIME_ASSERT(last_match_info->HasFastElements());
(...skipping 6566 matching lines...) Expand 10 before | Expand all | Expand 10 after
7601 } else { 7625 } else {
7602 // Handle last resort GC and make sure to allow future allocations 7626 // Handle last resort GC and make sure to allow future allocations
7603 // to grow the heap without causing GCs (if possible). 7627 // to grow the heap without causing GCs (if possible).
7604 Counters::gc_last_resort_from_js.Increment(); 7628 Counters::gc_last_resort_from_js.Increment();
7605 Heap::CollectAllGarbage(); 7629 Heap::CollectAllGarbage();
7606 } 7630 }
7607 } 7631 }
7608 7632
7609 7633
7610 } } // namespace v8::internal 7634 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698