| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 | 206 |
| 207 RUNTIME_FUNCTION(Runtime_GetOptimizationCount) { | 207 RUNTIME_FUNCTION(Runtime_GetOptimizationCount) { |
| 208 HandleScope scope(isolate); | 208 HandleScope scope(isolate); |
| 209 DCHECK(args.length() == 1); | 209 DCHECK(args.length() == 1); |
| 210 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 210 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 211 return Smi::FromInt(function->shared()->opt_count()); | 211 return Smi::FromInt(function->shared()->opt_count()); |
| 212 } | 212 } |
| 213 | 213 |
| 214 | 214 |
| 215 RUNTIME_FUNCTION(Runtime_GetUndetectable) { |
| 216 HandleScope scope(isolate); |
| 217 DCHECK(args.length() == 0); |
| 218 |
| 219 Local<v8::ObjectTemplate> desc = |
| 220 v8::ObjectTemplate::New((v8::Isolate*)isolate); |
| 221 desc->MarkAsUndetectable(); // undetectable |
| 222 Local<v8::Object> obj = desc->NewInstance(); |
| 223 return *Utils::OpenHandle(*obj); |
| 224 } |
| 225 |
| 226 |
| 215 RUNTIME_FUNCTION(Runtime_ClearFunctionTypeFeedback) { | 227 RUNTIME_FUNCTION(Runtime_ClearFunctionTypeFeedback) { |
| 216 HandleScope scope(isolate); | 228 HandleScope scope(isolate); |
| 217 DCHECK(args.length() == 1); | 229 DCHECK(args.length() == 1); |
| 218 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 230 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 219 function->shared()->ClearTypeFeedbackInfo(); | 231 function->shared()->ClearTypeFeedbackInfo(); |
| 220 Code* unoptimized = function->shared()->code(); | 232 Code* unoptimized = function->shared()->code(); |
| 221 if (unoptimized->kind() == Code::FUNCTION) { | 233 if (unoptimized->kind() == Code::FUNCTION) { |
| 222 unoptimized->ClearInlineCaches(); | 234 unoptimized->ClearInlineCaches(); |
| 223 } | 235 } |
| 224 return isolate->heap()->undefined_value(); | 236 return isolate->heap()->undefined_value(); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ | 495 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ |
| 484 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 496 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
| 485 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ | 497 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ |
| 486 } | 498 } |
| 487 | 499 |
| 488 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) | 500 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) |
| 489 | 501 |
| 490 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 502 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
| 491 } | 503 } |
| 492 } // namespace v8::internal | 504 } // namespace v8::internal |
| OLD | NEW |