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

Unified Diff: src/heap.cc

Issue 10780031: Grouping all map creation code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/handles.cc ('k') | src/objects.h » ('j') | src/runtime.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 81339fc04c38d319eeb8640aea2061a34416a24e..945e5233416fe228068361a31fa6f5417a5205b5 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -3709,11 +3709,10 @@ MaybeObject* Heap::AllocateFunctionPrototype(JSFunction* function) {
// constructors.
Map* new_map;
ASSERT(object_function->has_initial_map());
- { MaybeObject* maybe_map =
- object_function->initial_map()->CopyDropTransitions(
- DescriptorArray::MAY_BE_SHARED);
- if (!maybe_map->To<Map>(&new_map)) return maybe_map;
- }
+ MaybeObject* maybe_map =
+ object_function->initial_map()->Copy(DescriptorArray::MAY_BE_SHARED);
+ if (!maybe_map->To(&new_map)) return maybe_map;
+
Object* prototype;
{ MaybeObject* maybe_prototype = AllocateJSObjectFromMap(new_map);
Jakob Kummerow 2012/07/17 13:43:10 nit: for consistency, remove this {} too, please.
if (!maybe_prototype->ToObject(&prototype)) return maybe_prototype;
@@ -3721,11 +3720,11 @@ MaybeObject* Heap::AllocateFunctionPrototype(JSFunction* function) {
// When creating the prototype for the function we must set its
// constructor to the function.
Object* result;
- { MaybeObject* maybe_result =
- JSObject::cast(prototype)->SetLocalPropertyIgnoreAttributes(
- constructor_symbol(), function, DONT_ENUM);
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
+ MaybeObject* maybe_result =
+ JSObject::cast(prototype)->SetLocalPropertyIgnoreAttributes(
+ constructor_symbol(), function, DONT_ENUM);
+ if (!maybe_result->To(&result)) return maybe_result;
Jakob Kummerow 2012/07/17 13:43:10 Unless I'm missing something, this should rather b
+
return prototype;
}
« no previous file with comments | « src/handles.cc ('k') | src/objects.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698