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

Side by Side Diff: src/runtime.cc

Issue 10905308: Do not go to slow mode and back to fast in initializer blocks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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/x64/full-codegen-x64.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5014 matching lines...) Expand 10 before | Expand all | Expand 10 after
5025 5025
5026 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToFastProperties) { 5026 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToFastProperties) {
5027 ASSERT(args.length() == 1); 5027 ASSERT(args.length() == 1);
5028 Object* object = args[0]; 5028 Object* object = args[0];
5029 return (object->IsJSObject() && !object->IsGlobalObject()) 5029 return (object->IsJSObject() && !object->IsGlobalObject())
5030 ? JSObject::cast(object)->TransformToFastProperties(0) 5030 ? JSObject::cast(object)->TransformToFastProperties(0)
5031 : object; 5031 : object;
5032 } 5032 }
5033 5033
5034 5034
5035 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToSlowProperties) {
5036 ASSERT(args.length() == 1);
5037 Object* obj = args[0];
5038 return (obj->IsJSObject() && !obj->IsJSGlobalProxy())
5039 ? JSObject::cast(obj)->NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0)
5040 : obj;
5041 }
5042
5043
5044 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToBool) { 5035 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToBool) {
5045 NoHandleAllocation ha; 5036 NoHandleAllocation ha;
5046 ASSERT(args.length() == 1); 5037 ASSERT(args.length() == 1);
5047 5038
5048 return args[0]->ToBoolean(); 5039 return args[0]->ToBoolean();
5049 } 5040 }
5050 5041
5051 5042
5052 // Returns the type string of a value; see ECMA-262, 11.4.3 (p 47). 5043 // Returns the type string of a value; see ECMA-262, 11.4.3 (p 47).
5053 // Possible optimizations: put the type string into the oddballs. 5044 // Possible optimizations: put the type string into the oddballs.
(...skipping 8230 matching lines...) Expand 10 before | Expand all | Expand 10 after
13284 // Handle last resort GC and make sure to allow future allocations 13275 // Handle last resort GC and make sure to allow future allocations
13285 // to grow the heap without causing GCs (if possible). 13276 // to grow the heap without causing GCs (if possible).
13286 isolate->counters()->gc_last_resort_from_js()->Increment(); 13277 isolate->counters()->gc_last_resort_from_js()->Increment();
13287 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13278 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13288 "Runtime::PerformGC"); 13279 "Runtime::PerformGC");
13289 } 13280 }
13290 } 13281 }
13291 13282
13292 13283
13293 } } // namespace v8::internal 13284 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698