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/factory.h" | 5 #include "src/factory.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
9 #include "src/ast/ast-source-ranges.h" | 9 #include "src/ast/ast-source-ranges.h" |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 // bootstrapping. | 1497 // bootstrapping. |
1498 (has_code && (code->builtin_index() == Builtins::kEmptyFunction || | 1498 (has_code && (code->builtin_index() == Builtins::kEmptyFunction || |
1499 code->builtin_index() == Builtins::kProxyConstructor))); | 1499 code->builtin_index() == Builtins::kProxyConstructor))); |
1500 } else { | 1500 } else { |
1501 DCHECK( | 1501 DCHECK( |
1502 (*map == *isolate()->sloppy_function_map()) || | 1502 (*map == *isolate()->sloppy_function_map()) || |
1503 (*map == *isolate()->sloppy_function_without_prototype_map()) || | 1503 (*map == *isolate()->sloppy_function_without_prototype_map()) || |
1504 (*map == *isolate()->sloppy_function_with_readonly_prototype_map()) || | 1504 (*map == *isolate()->sloppy_function_with_readonly_prototype_map()) || |
1505 (*map == *isolate()->strict_function_map()) || | 1505 (*map == *isolate()->strict_function_map()) || |
1506 (*map == *isolate()->strict_function_without_prototype_map()) || | 1506 (*map == *isolate()->strict_function_without_prototype_map()) || |
1507 (*map == *isolate()->wasm_function_map()) || | |
1508 (*map == *isolate()->native_function_map())); | 1507 (*map == *isolate()->native_function_map())); |
1509 } | 1508 } |
1510 #endif | 1509 #endif |
1511 return NewFunction(map, info, context); | 1510 return NewFunction(map, info, context); |
1512 } | 1511 } |
1513 | 1512 |
1514 | 1513 |
1515 Handle<JSFunction> Factory::NewFunction(Handle<String> name) { | 1514 Handle<JSFunction> Factory::NewFunction(Handle<String> name) { |
1516 Handle<JSFunction> result = | 1515 Handle<JSFunction> result = |
1517 NewFunction(isolate()->sloppy_function_map(), name, MaybeHandle<Code>()); | 1516 NewFunction(isolate()->sloppy_function_map(), name, MaybeHandle<Code>()); |
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3055 Handle<AccessorInfo> prototype = | 3054 Handle<AccessorInfo> prototype = |
3056 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); | 3055 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); |
3057 Descriptor d = Descriptor::AccessorConstant( | 3056 Descriptor d = Descriptor::AccessorConstant( |
3058 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); | 3057 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); |
3059 map->AppendDescriptor(&d); | 3058 map->AppendDescriptor(&d); |
3060 } | 3059 } |
3061 } | 3060 } |
3062 | 3061 |
3063 } // namespace internal | 3062 } // namespace internal |
3064 } // namespace v8 | 3063 } // namespace v8 |
OLD | NEW |