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

Side by Side Diff: src/bootstrapper.cc

Issue 24566005: Internalize names before using them in slow-mode objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | « no previous file | src/objects.cc » ('j') | src/objects.cc » ('J')
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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 proto->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, 1036 proto->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex,
1037 Smi::FromInt(0), 1037 Smi::FromInt(0),
1038 SKIP_WRITE_BARRIER); // It's a Smi. 1038 SKIP_WRITE_BARRIER); // It's a Smi.
1039 initial_map->set_prototype(*proto); 1039 initial_map->set_prototype(*proto);
1040 factory->SetRegExpIrregexpData(Handle<JSRegExp>::cast(proto), 1040 factory->SetRegExpIrregexpData(Handle<JSRegExp>::cast(proto),
1041 JSRegExp::IRREGEXP, factory->empty_string(), 1041 JSRegExp::IRREGEXP, factory->empty_string(),
1042 JSRegExp::Flags(0), 0); 1042 JSRegExp::Flags(0), 0);
1043 } 1043 }
1044 1044
1045 { // -- J S O N 1045 { // -- J S O N
1046 Handle<String> name = factory->NewStringFromAscii(CStrVector("JSON")); 1046 Handle<String> name = factory->InternalizeUtf8String("JSON");
1047 Handle<JSFunction> cons = factory->NewFunction(name, 1047 Handle<JSFunction> cons = factory->NewFunction(name,
1048 factory->the_hole_value()); 1048 factory->the_hole_value());
1049 JSFunction::SetInstancePrototype(cons, 1049 JSFunction::SetInstancePrototype(cons,
1050 Handle<Object>(native_context()->initial_object_prototype(), isolate)); 1050 Handle<Object>(native_context()->initial_object_prototype(), isolate));
1051 cons->SetInstanceClassName(*name); 1051 cons->SetInstanceClassName(*name);
1052 Handle<JSObject> json_object = factory->NewJSObject(cons, TENURED); 1052 Handle<JSObject> json_object = factory->NewJSObject(cons, TENURED);
1053 ASSERT(json_object->IsJSObject()); 1053 ASSERT(json_object->IsJSObject());
1054 CHECK_NOT_EMPTY_HANDLE(isolate, 1054 CHECK_NOT_EMPTY_HANDLE(isolate,
1055 JSObject::SetLocalPropertyIgnoreAttributes( 1055 JSObject::SetLocalPropertyIgnoreAttributes(
1056 global, name, json_object, DONT_ENUM)); 1056 global, name, json_object, DONT_ENUM));
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2664 return from + sizeof(NestingCounterType); 2664 return from + sizeof(NestingCounterType);
2665 } 2665 }
2666 2666
2667 2667
2668 // Called when the top-level V8 mutex is destroyed. 2668 // Called when the top-level V8 mutex is destroyed.
2669 void Bootstrapper::FreeThreadResources() { 2669 void Bootstrapper::FreeThreadResources() {
2670 ASSERT(!IsActive()); 2670 ASSERT(!IsActive());
2671 } 2671 }
2672 2672
2673 } } // namespace v8::internal 2673 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698