Chromium Code Reviews| 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 constructor.prototype | |
|
adamk
2015/06/13 00:49:38
I'd expand this to something like:
// Set the "pr
Dan Ehrenberg
2015/06/13 05:54:09
Done.
| |
| 174 RUNTIME_FUNCTION(Runtime_FunctionSetPrototype) { | 175 RUNTIME_FUNCTION(Runtime_FunctionSetPrototype) { |
| 175 HandleScope scope(isolate); | 176 HandleScope scope(isolate); |
| 176 DCHECK(args.length() == 2); | 177 DCHECK(args.length() == 2); |
| 177 | 178 |
| 178 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); | 179 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
| 179 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 180 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 180 RUNTIME_ASSERT(fun->should_have_prototype()); | 181 RUNTIME_ASSERT(fun->should_have_prototype()); |
| 181 RETURN_FAILURE_ON_EXCEPTION(isolate, | 182 RETURN_FAILURE_ON_EXCEPTION(isolate, |
| 182 Accessors::FunctionSetPrototype(fun, value)); | 183 Accessors::FunctionSetPrototype(fun, value)); |
| 183 return args[0]; // return TOS | 184 return args[0]; // return TOS |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 623 | 624 |
| 624 | 625 |
| 625 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { | 626 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { |
| 626 HandleScope scope(isolate); | 627 HandleScope scope(isolate); |
| 627 DCHECK(args.length() == 0); | 628 DCHECK(args.length() == 0); |
| 628 THROW_NEW_ERROR_RETURN_FAILURE(isolate, | 629 THROW_NEW_ERROR_RETURN_FAILURE(isolate, |
| 629 NewTypeError(MessageTemplate::kStrongArity)); | 630 NewTypeError(MessageTemplate::kStrongArity)); |
| 630 } | 631 } |
| 631 } // namespace internal | 632 } // namespace internal |
| 632 } // namespace v8 | 633 } // namespace v8 |
| OLD | NEW |