| 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/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
| 9 #include "src/full-codegen.h" | 9 #include "src/full-codegen.h" |
| 10 #include "src/runtime/runtime-utils.h" | 10 #include "src/runtime/runtime-utils.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 HandleScope scope(isolate); | 209 HandleScope scope(isolate); |
| 210 DCHECK(args.length() == 1); | 210 DCHECK(args.length() == 1); |
| 211 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 211 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 212 return Smi::FromInt(function->shared()->opt_count()); | 212 return Smi::FromInt(function->shared()->opt_count()); |
| 213 } | 213 } |
| 214 | 214 |
| 215 | 215 |
| 216 RUNTIME_FUNCTION(Runtime_GetUndetectable) { | 216 RUNTIME_FUNCTION(Runtime_GetUndetectable) { |
| 217 HandleScope scope(isolate); | 217 HandleScope scope(isolate); |
| 218 DCHECK(args.length() == 0); | 218 DCHECK(args.length() == 0); |
| 219 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); |
| 219 | 220 |
| 220 Local<v8::ObjectTemplate> desc = | 221 Local<v8::ObjectTemplate> desc = v8::ObjectTemplate::New(v8_isolate); |
| 221 v8::ObjectTemplate::New((v8::Isolate*)isolate); | 222 desc->MarkAsUndetectable(); |
| 222 desc->MarkAsUndetectable(); // undetectable | 223 Local<v8::Object> obj; |
| 223 Local<v8::Object> obj = desc->NewInstance(); | 224 if (!desc->NewInstance(v8_isolate->GetCurrentContext()).ToLocal(&obj)) { |
| 225 return nullptr; |
| 226 } |
| 224 return *Utils::OpenHandle(*obj); | 227 return *Utils::OpenHandle(*obj); |
| 225 } | 228 } |
| 226 | 229 |
| 227 | 230 |
| 228 RUNTIME_FUNCTION(Runtime_ClearFunctionTypeFeedback) { | 231 RUNTIME_FUNCTION(Runtime_ClearFunctionTypeFeedback) { |
| 229 HandleScope scope(isolate); | 232 HandleScope scope(isolate); |
| 230 DCHECK(args.length() == 1); | 233 DCHECK(args.length() == 1); |
| 231 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 234 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 232 function->shared()->ClearTypeFeedbackInfo(); | 235 function->shared()->ClearTypeFeedbackInfo(); |
| 233 Code* unoptimized = function->shared()->code(); | 236 Code* unoptimized = function->shared()->code(); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ | 501 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ |
| 499 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 502 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
| 500 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ | 503 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ |
| 501 } | 504 } |
| 502 | 505 |
| 503 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) | 506 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) |
| 504 | 507 |
| 505 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 508 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
| 506 } // namespace internal | 509 } // namespace internal |
| 507 } // namespace v8 | 510 } // namespace v8 |
| OLD | NEW |