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

Side by Side Diff: src/factory.cc

Issue 12427: Merge regexp2000 back into bleeding_edge (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 Handle<Proxy> Factory::NewProxy(Address addr, PretenureFlag pretenure) { 163 Handle<Proxy> Factory::NewProxy(Address addr, PretenureFlag pretenure) {
164 CALL_HEAP_FUNCTION(Heap::AllocateProxy(addr, pretenure), Proxy); 164 CALL_HEAP_FUNCTION(Heap::AllocateProxy(addr, pretenure), Proxy);
165 } 165 }
166 166
167 167
168 Handle<Proxy> Factory::NewProxy(const AccessorDescriptor* desc) { 168 Handle<Proxy> Factory::NewProxy(const AccessorDescriptor* desc) {
169 return NewProxy((Address) desc, TENURED); 169 return NewProxy((Address) desc, TENURED);
170 } 170 }
171 171
172 172
173 Handle<ByteArray> Factory::NewByteArray(int length) { 173 Handle<ByteArray> Factory::NewByteArray(int length, PretenureFlag pretenure) {
174 ASSERT(0 <= length); 174 ASSERT(0 <= length);
175 CALL_HEAP_FUNCTION(Heap::AllocateByteArray(length), ByteArray); 175 CALL_HEAP_FUNCTION(Heap::AllocateByteArray(length, pretenure), ByteArray);
176 } 176 }
177 177
178 178
179 Handle<Map> Factory::NewMap(InstanceType type, int instance_size) { 179 Handle<Map> Factory::NewMap(InstanceType type, int instance_size) {
180 CALL_HEAP_FUNCTION(Heap::AllocateMap(type, instance_size), Map); 180 CALL_HEAP_FUNCTION(Heap::AllocateMap(type, instance_size), Map);
181 } 181 }
182 182
183 183
184 Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) { 184 Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) {
185 CALL_HEAP_FUNCTION(Heap::AllocateFunctionPrototype(*function), JSObject); 185 CALL_HEAP_FUNCTION(Heap::AllocateFunctionPrototype(*function), JSObject);
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 451
452 // Set function.prototype and give the prototype a constructor 452 // Set function.prototype and give the prototype a constructor
453 // property that refers to the function. 453 // property that refers to the function.
454 SetPrototypeProperty(function, prototype); 454 SetPrototypeProperty(function, prototype);
455 SetProperty(prototype, Factory::constructor_symbol(), function, DONT_ENUM); 455 SetProperty(prototype, Factory::constructor_symbol(), function, DONT_ENUM);
456 return function; 456 return function;
457 } 457 }
458 458
459 459
460 Handle<Code> Factory::NewCode(const CodeDesc& desc, ScopeInfo<>* sinfo, 460 Handle<Code> Factory::NewCode(const CodeDesc& desc, ScopeInfo<>* sinfo,
461 Code::Flags flags, Handle<Object> self_ref) {
462 CALL_HEAP_FUNCTION(Heap::CreateCode(
463 desc, sinfo, flags, reinterpret_cast<Code**>(self_ref.location())), Code);
464 }
465
466 Handle<Code> Factory::NewCode(const CodeDesc& desc, ScopeInfo<>* sinfo,
461 Code::Flags flags) { 467 Code::Flags flags) {
462 CALL_HEAP_FUNCTION(Heap::CreateCode(desc, sinfo, flags), Code); 468 CALL_HEAP_FUNCTION(Heap::CreateCode(desc, sinfo, flags, NULL), Code);
463 } 469 }
464 470
465 471
466 Handle<Code> Factory::CopyCode(Handle<Code> code) { 472 Handle<Code> Factory::CopyCode(Handle<Code> code) {
467 CALL_HEAP_FUNCTION(Heap::CopyCode(*code), Code); 473 CALL_HEAP_FUNCTION(Heap::CopyCode(*code), Code);
468 } 474 }
469 475
470 476
471 static inline Object* DoCopyInsert(DescriptorArray* array, 477 static inline Object* DoCopyInsert(DescriptorArray* array,
472 String* key, 478 String* key,
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 case OuterGlobalObject: 705 case OuterGlobalObject:
700 type = JS_GLOBAL_PROXY_TYPE; 706 type = JS_GLOBAL_PROXY_TYPE;
701 instance_size += JSGlobalProxy::kSize; 707 instance_size += JSGlobalProxy::kSize;
702 break; 708 break;
703 default: 709 default:
704 break; 710 break;
705 } 711 }
706 ASSERT(type != INVALID_TYPE); 712 ASSERT(type != INVALID_TYPE);
707 713
708 Handle<JSFunction> result = 714 Handle<JSFunction> result =
709 Factory::NewFunction(Factory::empty_symbol(), type, instance_size, 715 Factory::NewFunction(Factory::empty_symbol(),
710 code, true); 716 type,
717 instance_size,
718 code,
719 true);
711 // Set class name. 720 // Set class name.
712 Handle<Object> class_name = Handle<Object>(obj->class_name()); 721 Handle<Object> class_name = Handle<Object>(obj->class_name());
713 if (class_name->IsString()) { 722 if (class_name->IsString()) {
714 result->shared()->set_instance_class_name(*class_name); 723 result->shared()->set_instance_class_name(*class_name);
715 result->shared()->set_name(*class_name); 724 result->shared()->set_name(*class_name);
716 } 725 }
717 726
718 Handle<Map> map = Handle<Map>(result->initial_map()); 727 Handle<Map> map = Handle<Map>(result->initial_map());
719 728
720 // Mark as undetectable if needed. 729 // Mark as undetectable if needed.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 Execution::ConfigureInstance(instance, 842 Execution::ConfigureInstance(instance,
834 instance_template, 843 instance_template,
835 pending_exception); 844 pending_exception);
836 } else { 845 } else {
837 *pending_exception = false; 846 *pending_exception = false;
838 } 847 }
839 } 848 }
840 849
841 850
842 } } // namespace v8::internal 851 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698