| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 Builtins::Name builtin_name) { | 680 Builtins::Name builtin_name) { |
| 681 Handle<String> name = | 681 Handle<String> name = |
| 682 factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("ThrowTypeError")); | 682 factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("ThrowTypeError")); |
| 683 Handle<Code> code(isolate()->builtins()->builtin(builtin_name)); | 683 Handle<Code> code(isolate()->builtins()->builtin(builtin_name)); |
| 684 Handle<JSFunction> function = | 684 Handle<JSFunction> function = |
| 685 factory()->NewFunctionWithoutPrototype(name, code); | 685 factory()->NewFunctionWithoutPrototype(name, code); |
| 686 function->set_map(native_context()->sloppy_function_map()); | 686 function->set_map(native_context()->sloppy_function_map()); |
| 687 function->shared()->DontAdaptArguments(); | 687 function->shared()->DontAdaptArguments(); |
| 688 | 688 |
| 689 // %ThrowTypeError% must not have a name property. | 689 // %ThrowTypeError% must not have a name property. |
| 690 JSReceiver::DeleteProperty(function, factory()->name_string()).Assert(); | 690 if (JSReceiver::DeleteProperty(function, factory()->name_string()) |
| 691 .IsNothing()) |
| 692 DCHECK(false); |
| 691 | 693 |
| 692 // length needs to be non configurable. | 694 // length needs to be non configurable. |
| 693 Handle<Object> value(Smi::FromInt(function->shared()->length()), isolate()); | 695 Handle<Object> value(Smi::FromInt(function->shared()->length()), isolate()); |
| 694 JSObject::SetOwnPropertyIgnoreAttributes( | 696 JSObject::SetOwnPropertyIgnoreAttributes( |
| 695 function, factory()->length_string(), value, | 697 function, factory()->length_string(), value, |
| 696 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)) | 698 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)) |
| 697 .Assert(); | 699 .Assert(); |
| 698 | 700 |
| 699 if (JSObject::PreventExtensions(function, Object::THROW_ON_ERROR).IsNothing()) | 701 if (JSObject::PreventExtensions(function, Object::THROW_ON_ERROR).IsNothing()) |
| 700 DCHECK(false); | 702 DCHECK(false); |
| (...skipping 2557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3258 } | 3260 } |
| 3259 | 3261 |
| 3260 | 3262 |
| 3261 // Called when the top-level V8 mutex is destroyed. | 3263 // Called when the top-level V8 mutex is destroyed. |
| 3262 void Bootstrapper::FreeThreadResources() { | 3264 void Bootstrapper::FreeThreadResources() { |
| 3263 DCHECK(!IsActive()); | 3265 DCHECK(!IsActive()); |
| 3264 } | 3266 } |
| 3265 | 3267 |
| 3266 } // namespace internal | 3268 } // namespace internal |
| 3267 } // namespace v8 | 3269 } // namespace v8 |
| OLD | NEW |