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/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 DCHECK(target_function->IsCallable()); | 1949 DCHECK(target_function->IsCallable()); |
1950 STATIC_ASSERT(Code::kMaxArguments <= FixedArray::kMaxLength); | 1950 STATIC_ASSERT(Code::kMaxArguments <= FixedArray::kMaxLength); |
1951 if (bound_args.length() >= Code::kMaxArguments) { | 1951 if (bound_args.length() >= Code::kMaxArguments) { |
1952 THROW_NEW_ERROR(isolate(), | 1952 THROW_NEW_ERROR(isolate(), |
1953 NewRangeError(MessageTemplate::kTooManyArguments), | 1953 NewRangeError(MessageTemplate::kTooManyArguments), |
1954 JSBoundFunction); | 1954 JSBoundFunction); |
1955 } | 1955 } |
1956 | 1956 |
1957 // Determine the prototype of the {target_function}. | 1957 // Determine the prototype of the {target_function}. |
1958 Handle<Object> prototype; | 1958 Handle<Object> prototype; |
1959 ASSIGN_RETURN_ON_EXCEPTION(isolate(), prototype, | 1959 ASSIGN_RETURN_ON_EXCEPTION( |
1960 Object::GetPrototype(isolate(), target_function), | 1960 isolate(), prototype, |
1961 JSBoundFunction); | 1961 JSReceiver::GetPrototype(isolate(), target_function), JSBoundFunction); |
1962 | 1962 |
1963 // Create the [[BoundArguments]] for the result. | 1963 // Create the [[BoundArguments]] for the result. |
1964 Handle<FixedArray> bound_arguments; | 1964 Handle<FixedArray> bound_arguments; |
1965 if (bound_args.length() == 0) { | 1965 if (bound_args.length() == 0) { |
1966 bound_arguments = empty_fixed_array(); | 1966 bound_arguments = empty_fixed_array(); |
1967 } else { | 1967 } else { |
1968 bound_arguments = NewFixedArray(bound_args.length()); | 1968 bound_arguments = NewFixedArray(bound_args.length()); |
1969 for (int i = 0; i < bound_args.length(); ++i) { | 1969 for (int i = 0; i < bound_args.length(); ++i) { |
1970 bound_arguments->set(i, *bound_args[i]); | 1970 bound_arguments->set(i, *bound_args[i]); |
1971 } | 1971 } |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2386 } | 2386 } |
2387 | 2387 |
2388 | 2388 |
2389 Handle<Object> Factory::ToBoolean(bool value) { | 2389 Handle<Object> Factory::ToBoolean(bool value) { |
2390 return value ? true_value() : false_value(); | 2390 return value ? true_value() : false_value(); |
2391 } | 2391 } |
2392 | 2392 |
2393 | 2393 |
2394 } // namespace internal | 2394 } // namespace internal |
2395 } // namespace v8 | 2395 } // namespace v8 |
OLD | NEW |