| 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.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 DCHECK(!map->IsUndefined(isolate())); | 1406 DCHECK(!map->IsUndefined(isolate())); |
| 1407 DCHECK( | 1407 DCHECK( |
| 1408 map.is_identical_to(isolate()->sloppy_function_map()) || | 1408 map.is_identical_to(isolate()->sloppy_function_map()) || |
| 1409 map.is_identical_to(isolate()->sloppy_function_without_prototype_map()) || | 1409 map.is_identical_to(isolate()->sloppy_function_without_prototype_map()) || |
| 1410 map.is_identical_to( | 1410 map.is_identical_to( |
| 1411 isolate()->sloppy_function_with_readonly_prototype_map()) || | 1411 isolate()->sloppy_function_with_readonly_prototype_map()) || |
| 1412 map.is_identical_to(isolate()->strict_function_map()) || | 1412 map.is_identical_to(isolate()->strict_function_map()) || |
| 1413 map.is_identical_to(isolate()->strict_function_without_prototype_map()) || | 1413 map.is_identical_to(isolate()->strict_function_without_prototype_map()) || |
| 1414 // TODO(titzer): wasm_function_map() could be undefined here. ugly. | 1414 // TODO(titzer): wasm_function_map() could be undefined here. ugly. |
| 1415 (*map == context->get(Context::WASM_FUNCTION_MAP_INDEX)) || | 1415 (*map == context->get(Context::WASM_FUNCTION_MAP_INDEX)) || |
| 1416 (*map == context->get(Context::NATIVE_FUNCTION_MAP_INDEX)) || |
| 1416 map.is_identical_to(isolate()->proxy_function_map())); | 1417 map.is_identical_to(isolate()->proxy_function_map())); |
| 1417 return NewFunction(map, info, context); | 1418 return NewFunction(map, info, context); |
| 1418 } | 1419 } |
| 1419 | 1420 |
| 1420 | 1421 |
| 1421 Handle<JSFunction> Factory::NewFunction(Handle<String> name) { | 1422 Handle<JSFunction> Factory::NewFunction(Handle<String> name) { |
| 1422 return NewFunction( | 1423 return NewFunction( |
| 1423 isolate()->sloppy_function_map(), name, MaybeHandle<Code>()); | 1424 isolate()->sloppy_function_map(), name, MaybeHandle<Code>()); |
| 1424 } | 1425 } |
| 1425 | 1426 |
| (...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2769 Handle<AccessorInfo> prototype = | 2770 Handle<AccessorInfo> prototype = |
| 2770 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); | 2771 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); |
| 2771 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), | 2772 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())), |
| 2772 prototype, rw_attribs); | 2773 prototype, rw_attribs); |
| 2773 map->AppendDescriptor(&d); | 2774 map->AppendDescriptor(&d); |
| 2774 } | 2775 } |
| 2775 } | 2776 } |
| 2776 | 2777 |
| 2777 } // namespace internal | 2778 } // namespace internal |
| 2778 } // namespace v8 | 2779 } // namespace v8 |
| OLD | NEW |