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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 CONVERT_ARG_CHECKED(JSFunction, fun, 0); | 165 CONVERT_ARG_CHECKED(JSFunction, fun, 0); |
166 CONVERT_SMI_ARG_CHECKED(length, 1); | 166 CONVERT_SMI_ARG_CHECKED(length, 1); |
167 RUNTIME_ASSERT((length & 0xC0000000) == 0xC0000000 || | 167 RUNTIME_ASSERT((length & 0xC0000000) == 0xC0000000 || |
168 (length & 0xC0000000) == 0x0); | 168 (length & 0xC0000000) == 0x0); |
169 fun->shared()->set_length(length); | 169 fun->shared()->set_length(length); |
170 return isolate->heap()->undefined_value(); | 170 return isolate->heap()->undefined_value(); |
171 } | 171 } |
172 | 172 |
173 | 173 |
174 // Set the "prototype" property of a constructor Function. | |
175 RUNTIME_FUNCTION(Runtime_FunctionSetPrototype) { | 174 RUNTIME_FUNCTION(Runtime_FunctionSetPrototype) { |
176 HandleScope scope(isolate); | 175 HandleScope scope(isolate); |
177 DCHECK(args.length() == 2); | 176 DCHECK(args.length() == 2); |
178 | 177 |
179 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); | 178 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
180 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 179 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
181 RUNTIME_ASSERT(fun->should_have_prototype()); | 180 RUNTIME_ASSERT(fun->should_have_prototype()); |
182 RETURN_FAILURE_ON_EXCEPTION(isolate, | 181 RETURN_FAILURE_ON_EXCEPTION(isolate, |
183 Accessors::FunctionSetPrototype(fun, value)); | 182 Accessors::FunctionSetPrototype(fun, value)); |
184 return args[0]; // return TOS | 183 return args[0]; // return TOS |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 | 623 |
625 | 624 |
626 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { | 625 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { |
627 HandleScope scope(isolate); | 626 HandleScope scope(isolate); |
628 DCHECK(args.length() == 0); | 627 DCHECK(args.length() == 0); |
629 THROW_NEW_ERROR_RETURN_FAILURE(isolate, | 628 THROW_NEW_ERROR_RETURN_FAILURE(isolate, |
630 NewTypeError(MessageTemplate::kStrongArity)); | 629 NewTypeError(MessageTemplate::kStrongArity)); |
631 } | 630 } |
632 } // namespace internal | 631 } // namespace internal |
633 } // namespace v8 | 632 } // namespace v8 |
OLD | NEW |