OLD | NEW |
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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 Handle<String> symbol = factory->LookupAsciiSymbol(name); | 343 Handle<String> symbol = factory->LookupAsciiSymbol(name); |
344 Handle<Code> call_code = Handle<Code>(isolate->builtins()->builtin(call)); | 344 Handle<Code> call_code = Handle<Code>(isolate->builtins()->builtin(call)); |
345 Handle<JSFunction> function = prototype.is_null() ? | 345 Handle<JSFunction> function = prototype.is_null() ? |
346 factory->NewFunctionWithoutPrototype(symbol, call_code) : | 346 factory->NewFunctionWithoutPrototype(symbol, call_code) : |
347 factory->NewFunctionWithPrototype(symbol, | 347 factory->NewFunctionWithPrototype(symbol, |
348 type, | 348 type, |
349 instance_size, | 349 instance_size, |
350 prototype, | 350 prototype, |
351 call_code, | 351 call_code, |
352 is_ecma_native); | 352 is_ecma_native); |
353 SetLocalPropertyNoThrow(target, symbol, function, DONT_ENUM); | 353 PropertyAttributes attributes; |
| 354 if (target->IsJSBuiltinsObject()) { |
| 355 attributes = |
| 356 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 357 } else { |
| 358 attributes = DONT_ENUM; |
| 359 } |
| 360 SetLocalPropertyNoThrow(target, symbol, function, attributes); |
354 if (is_ecma_native) { | 361 if (is_ecma_native) { |
355 function->shared()->set_instance_class_name(*symbol); | 362 function->shared()->set_instance_class_name(*symbol); |
356 } | 363 } |
357 return function; | 364 return function; |
358 } | 365 } |
359 | 366 |
360 | 367 |
361 Handle<DescriptorArray> Genesis::ComputeFunctionInstanceDescriptor( | 368 Handle<DescriptorArray> Genesis::ComputeFunctionInstanceDescriptor( |
362 PrototypePropertyMode prototypeMode) { | 369 PrototypePropertyMode prototypeMode) { |
363 Handle<DescriptorArray> descriptors = | 370 Handle<DescriptorArray> descriptors = |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 reresult_descriptors->Sort(); | 1677 reresult_descriptors->Sort(); |
1671 | 1678 |
1672 initial_map->set_inobject_properties(2); | 1679 initial_map->set_inobject_properties(2); |
1673 initial_map->set_pre_allocated_property_fields(2); | 1680 initial_map->set_pre_allocated_property_fields(2); |
1674 initial_map->set_unused_property_fields(0); | 1681 initial_map->set_unused_property_fields(0); |
1675 initial_map->set_instance_descriptors(*reresult_descriptors); | 1682 initial_map->set_instance_descriptors(*reresult_descriptors); |
1676 | 1683 |
1677 global_context()->set_regexp_result_map(*initial_map); | 1684 global_context()->set_regexp_result_map(*initial_map); |
1678 } | 1685 } |
1679 | 1686 |
1680 | |
1681 #ifdef DEBUG | 1687 #ifdef DEBUG |
1682 builtins->Verify(); | 1688 builtins->Verify(); |
1683 #endif | 1689 #endif |
1684 | 1690 |
1685 return true; | 1691 return true; |
1686 } | 1692 } |
1687 | 1693 |
1688 | 1694 |
1689 bool Genesis::InstallExperimentalNatives() { | 1695 bool Genesis::InstallExperimentalNatives() { |
1690 for (int i = ExperimentalNatives::GetDebuggerCount(); | 1696 for (int i = ExperimentalNatives::GetDebuggerCount(); |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2219 return from + sizeof(NestingCounterType); | 2225 return from + sizeof(NestingCounterType); |
2220 } | 2226 } |
2221 | 2227 |
2222 | 2228 |
2223 // Called when the top-level V8 mutex is destroyed. | 2229 // Called when the top-level V8 mutex is destroyed. |
2224 void Bootstrapper::FreeThreadResources() { | 2230 void Bootstrapper::FreeThreadResources() { |
2225 ASSERT(!IsActive()); | 2231 ASSERT(!IsActive()); |
2226 } | 2232 } |
2227 | 2233 |
2228 } } // namespace v8::internal | 2234 } } // namespace v8::internal |
OLD | NEW |