Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1059)

Side by Side Diff: src/runtime/runtime-test.cc

Issue 1132303003: Add %GetUndetectable() test intrinsic and add tests for undetectables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/undetectable.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/undetectable.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698