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

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

Issue 781953002: Allow eval in detached contexts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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') | src/v8natives.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/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug.h" 9 #include "src/debug.h"
10 #include "src/runtime/runtime.h" 10 #include "src/runtime/runtime.h"
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 1361
1362 RUNTIME_FUNCTION(Runtime_GlobalProxy) { 1362 RUNTIME_FUNCTION(Runtime_GlobalProxy) {
1363 SealHandleScope shs(isolate); 1363 SealHandleScope shs(isolate);
1364 DCHECK(args.length() == 1); 1364 DCHECK(args.length() == 1);
1365 CONVERT_ARG_CHECKED(Object, global, 0); 1365 CONVERT_ARG_CHECKED(Object, global, 0);
1366 if (!global->IsJSGlobalObject()) return isolate->heap()->null_value(); 1366 if (!global->IsJSGlobalObject()) return isolate->heap()->null_value();
1367 return JSGlobalObject::cast(global)->global_proxy(); 1367 return JSGlobalObject::cast(global)->global_proxy();
1368 } 1368 }
1369 1369
1370 1370
1371 RUNTIME_FUNCTION(Runtime_IsAttachedGlobal) {
1372 SealHandleScope shs(isolate);
1373 DCHECK(args.length() == 1);
1374 CONVERT_ARG_CHECKED(Object, global, 0);
1375 if (!global->IsJSGlobalObject()) return isolate->heap()->false_value();
1376 return isolate->heap()->ToBoolean(
1377 !JSGlobalObject::cast(global)->IsDetached());
1378 }
1379
1380
1381 RUNTIME_FUNCTION(Runtime_LookupAccessor) { 1371 RUNTIME_FUNCTION(Runtime_LookupAccessor) {
1382 HandleScope scope(isolate); 1372 HandleScope scope(isolate);
1383 DCHECK(args.length() == 3); 1373 DCHECK(args.length() == 3);
1384 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, receiver, 0); 1374 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, receiver, 0);
1385 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 1375 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
1386 CONVERT_SMI_ARG_CHECKED(flag, 2); 1376 CONVERT_SMI_ARG_CHECKED(flag, 2);
1387 AccessorComponent component = flag == 0 ? ACCESSOR_GETTER : ACCESSOR_SETTER; 1377 AccessorComponent component = flag == 0 ? ACCESSOR_GETTER : ACCESSOR_SETTER;
1388 if (!receiver->IsJSObject()) return isolate->heap()->undefined_value(); 1378 if (!receiver->IsJSObject()) return isolate->heap()->undefined_value();
1389 Handle<Object> result; 1379 Handle<Object> result;
1390 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1380 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 1585
1596 RUNTIME_FUNCTION(RuntimeReference_ClassOf) { 1586 RUNTIME_FUNCTION(RuntimeReference_ClassOf) {
1597 SealHandleScope shs(isolate); 1587 SealHandleScope shs(isolate);
1598 DCHECK(args.length() == 1); 1588 DCHECK(args.length() == 1);
1599 CONVERT_ARG_CHECKED(Object, obj, 0); 1589 CONVERT_ARG_CHECKED(Object, obj, 0);
1600 if (!obj->IsJSReceiver()) return isolate->heap()->null_value(); 1590 if (!obj->IsJSReceiver()) return isolate->heap()->null_value();
1601 return JSReceiver::cast(obj)->class_name(); 1591 return JSReceiver::cast(obj)->class_name();
1602 } 1592 }
1603 } 1593 }
1604 } // namespace v8::internal 1594 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698