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

Side by Side Diff: src/objects.cc

Issue 32323013: Introduce JSFunction::EnsureHasInitialMap method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/objects.h ('k') | src/runtime.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 9874 matching lines...) Expand 10 before | Expand all | Expand 10 after
9885 9885
9886 ASSERT(map() == (shared()->is_classic_mode() 9886 ASSERT(map() == (shared()->is_classic_mode()
9887 ? native_context->function_map() 9887 ? native_context->function_map()
9888 : native_context->strict_mode_function_map())); 9888 : native_context->strict_mode_function_map()));
9889 9889
9890 set_map(no_prototype_map); 9890 set_map(no_prototype_map);
9891 set_prototype_or_initial_map(no_prototype_map->GetHeap()->the_hole_value()); 9891 set_prototype_or_initial_map(no_prototype_map->GetHeap()->the_hole_value());
9892 } 9892 }
9893 9893
9894 9894
9895 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) {
9896 if (function->has_initial_map()) return;
9897 Isolate* isolate = function->GetIsolate();
9898 Handle<Map> initial_map = isolate->factory()->NewInitialMap(function);
9899 function->set_initial_map(*initial_map);
9900 initial_map->set_constructor(*function);
9901 }
9902
9903
9895 void JSFunction::SetInstanceClassName(String* name) { 9904 void JSFunction::SetInstanceClassName(String* name) {
9896 shared()->set_instance_class_name(name); 9905 shared()->set_instance_class_name(name);
9897 } 9906 }
9898 9907
9899 9908
9900 void JSFunction::PrintName(FILE* out) { 9909 void JSFunction::PrintName(FILE* out) {
9901 SmartArrayPointer<char> name = shared()->DebugName()->ToCString(); 9910 SmartArrayPointer<char> name = shared()->DebugName()->ToCString();
9902 PrintF(out, "%s", *name); 9911 PrintF(out, "%s", *name);
9903 } 9912 }
9904 9913
(...skipping 6481 matching lines...) Expand 10 before | Expand all | Expand 10 after
16386 #define ERROR_MESSAGES_TEXTS(C, T) T, 16395 #define ERROR_MESSAGES_TEXTS(C, T) T,
16387 static const char* error_messages_[] = { 16396 static const char* error_messages_[] = {
16388 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16397 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16389 }; 16398 };
16390 #undef ERROR_MESSAGES_TEXTS 16399 #undef ERROR_MESSAGES_TEXTS
16391 return error_messages_[reason]; 16400 return error_messages_[reason];
16392 } 16401 }
16393 16402
16394 16403
16395 } } // namespace v8::internal 16404 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698