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

Side by Side Diff: src/heap.cc

Issue 7628021: Make function proxies work as constructors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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/arm/builtins-arm.cc ('k') | src/ia32/builtins-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3464 matching lines...) Expand 10 before | Expand all | Expand 10 after
3475 3475
3476 // Reset the map for the object. 3476 // Reset the map for the object.
3477 object->set_map(map); 3477 object->set_map(map);
3478 3478
3479 // Reinitialize the object from the constructor map. 3479 // Reinitialize the object from the constructor map.
3480 InitializeJSObjectFromMap(JSObject::cast(object), 3480 InitializeJSObjectFromMap(JSObject::cast(object),
3481 FixedArray::cast(properties), map); 3481 FixedArray::cast(properties), map);
3482 3482
3483 // Functions require some minimal initialization. 3483 // Functions require some minimal initialization.
3484 if (type == JS_FUNCTION_TYPE) { 3484 if (type == JS_FUNCTION_TYPE) {
3485 map->set_function_with_prototype(true);
3485 String* name; 3486 String* name;
3486 MaybeObject* maybe_name = LookupAsciiSymbol("<freezing call trap>"); 3487 MaybeObject* maybe_name = LookupAsciiSymbol("<freezing call trap>");
3487 if (!maybe_name->To<String>(&name)) return maybe_name; 3488 if (!maybe_name->To<String>(&name)) return maybe_name;
3488 SharedFunctionInfo* shared; 3489 SharedFunctionInfo* shared;
3489 MaybeObject* maybe_shared = AllocateSharedFunctionInfo(name); 3490 MaybeObject* maybe_shared = AllocateSharedFunctionInfo(name);
3490 if (!maybe_shared->To<SharedFunctionInfo>(&shared)) return maybe_shared; 3491 if (!maybe_shared->To<SharedFunctionInfo>(&shared)) return maybe_shared;
3491 JSFunction* func; 3492 JSFunction* func;
3492 MaybeObject* maybe_func = 3493 MaybeObject* maybe_func =
3493 InitializeFunction(JSFunction::cast(object), shared, the_hole_value()); 3494 InitializeFunction(JSFunction::cast(object), shared, the_hole_value());
3494 if (!maybe_func->To<JSFunction>(&func)) return maybe_func; 3495 if (!maybe_func->To<JSFunction>(&func)) return maybe_func;
(...skipping 2608 matching lines...) Expand 10 before | Expand all | Expand 10 after
6103 } 6104 }
6104 6105
6105 6106
6106 void ExternalStringTable::TearDown() { 6107 void ExternalStringTable::TearDown() {
6107 new_space_strings_.Free(); 6108 new_space_strings_.Free();
6108 old_space_strings_.Free(); 6109 old_space_strings_.Free();
6109 } 6110 }
6110 6111
6111 6112
6112 } } // namespace v8::internal 6113 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698