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

Side by Side Diff: src/runtime.cc

Issue 27128: Go into slow case when encountering object initialization on the top level to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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
« src/parser.cc ('K') | « src/runtime.h ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 2144
2145 // Handle special arguments properties. 2145 // Handle special arguments properties.
2146 if (key->Equals(Heap::length_symbol())) return Smi::FromInt(n); 2146 if (key->Equals(Heap::length_symbol())) return Smi::FromInt(n);
2147 if (key->Equals(Heap::callee_symbol())) return frame->function(); 2147 if (key->Equals(Heap::callee_symbol())) return frame->function();
2148 2148
2149 // Lookup in the initial Object.prototype object. 2149 // Lookup in the initial Object.prototype object.
2150 return Top::initial_object_prototype()->GetProperty(*key); 2150 return Top::initial_object_prototype()->GetProperty(*key);
2151 } 2151 }
2152 2152
2153 2153
2154 static Object* Runtime_ToFastProperties(Arguments args) {
2155 ASSERT(args.length() == 1);
2156 CONVERT_ARG_CHECKED(JSObject, object, 0);
2157 object->TransformToFastProperties(0);
2158 return *object;
2159 }
2160
2161
2162 static Object* Runtime_ToSlowProperties(Arguments args) {
2163 ASSERT(args.length() == 1);
2164 CONVERT_ARG_CHECKED(JSObject, object, 0);
2165 object->NormalizeProperties(CLEAR_INOBJECT_PROPERTIES);
2166 return *object;
2167 }
2168
2169
2154 static Object* Runtime_ToBool(Arguments args) { 2170 static Object* Runtime_ToBool(Arguments args) {
2155 NoHandleAllocation ha; 2171 NoHandleAllocation ha;
2156 ASSERT(args.length() == 1); 2172 ASSERT(args.length() == 1);
2157 2173
2158 return args[0]->ToBoolean(); 2174 return args[0]->ToBoolean();
2159 } 2175 }
2160 2176
2161 2177
2162 // Returns the type string of a value; see ECMA-262, 11.4.3 (p 47). 2178 // Returns the type string of a value; see ECMA-262, 11.4.3 (p 47).
2163 // Possible optimizations: put the type string into the oddballs. 2179 // Possible optimizations: put the type string into the oddballs.
(...skipping 3932 matching lines...) Expand 10 before | Expand all | Expand 10 after
6096 } else { 6112 } else {
6097 // Handle last resort GC and make sure to allow future allocations 6113 // Handle last resort GC and make sure to allow future allocations
6098 // to grow the heap without causing GCs (if possible). 6114 // to grow the heap without causing GCs (if possible).
6099 Counters::gc_last_resort_from_js.Increment(); 6115 Counters::gc_last_resort_from_js.Increment();
6100 Heap::CollectAllGarbage(); 6116 Heap::CollectAllGarbage();
6101 } 6117 }
6102 } 6118 }
6103 6119
6104 6120
6105 } } // namespace v8::internal 6121 } } // namespace v8::internal
OLDNEW
« src/parser.cc ('K') | « src/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698