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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.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/frames-inl.h" | 10 #include "src/frames-inl.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 RUNTIME_FUNCTION(Runtime_FunctionSetName) { | 33 RUNTIME_FUNCTION(Runtime_FunctionSetName) { |
| 34 HandleScope scope(isolate); | 34 HandleScope scope(isolate); |
| 35 DCHECK(args.length() == 2); | 35 DCHECK(args.length() == 2); |
| 36 | 36 |
| 37 CONVERT_ARG_HANDLE_CHECKED(JSFunction, f, 0); | 37 CONVERT_ARG_HANDLE_CHECKED(JSFunction, f, 0); |
| 38 CONVERT_ARG_HANDLE_CHECKED(String, name, 1); | 38 CONVERT_ARG_HANDLE_CHECKED(String, name, 1); |
| 39 | 39 |
| 40 name = String::Flatten(name); | 40 name = String::Flatten(name); |
| 41 f->shared()->set_name(*name); | 41 f->shared()->set_name(*name); |
| 42 return isolate->heap()->undefined_value(); | 42 return *f; |
|
adamk
2016/07/13 18:38:22
I think you won't need this change after you chang
neis
2016/07/14 10:28:24
Done.
| |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 RUNTIME_FUNCTION(Runtime_FunctionRemovePrototype) { | 46 RUNTIME_FUNCTION(Runtime_FunctionRemovePrototype) { |
| 47 SealHandleScope shs(isolate); | 47 SealHandleScope shs(isolate); |
| 48 DCHECK(args.length() == 1); | 48 DCHECK(args.length() == 1); |
| 49 | 49 |
| 50 CONVERT_ARG_CHECKED(JSFunction, f, 0); | 50 CONVERT_ARG_CHECKED(JSFunction, f, 0); |
| 51 CHECK(f->RemovePrototype()); | 51 CHECK(f->RemovePrototype()); |
| 52 f->shared()->SetConstructStub( | 52 f->shared()->SetConstructStub( |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 DCHECK_EQ(1, args.length()); | 296 DCHECK_EQ(1, args.length()); |
| 297 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); | 297 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); |
| 298 return function->IsJSBoundFunction() | 298 return function->IsJSBoundFunction() |
| 299 ? *JSBoundFunction::ToString( | 299 ? *JSBoundFunction::ToString( |
| 300 Handle<JSBoundFunction>::cast(function)) | 300 Handle<JSBoundFunction>::cast(function)) |
| 301 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); | 301 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); |
| 302 } | 302 } |
| 303 | 303 |
| 304 } // namespace internal | 304 } // namespace internal |
| 305 } // namespace v8 | 305 } // namespace v8 |
| OLD | NEW |