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

Side by Side Diff: src/runtime.cc

Issue 274163002: Harden %SetIsObserved with RUNTIME_ASSERTs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "accessors.h" 10 #include "accessors.h"
(...skipping 14879 matching lines...) Expand 10 before | Expand all | Expand 10 after
14890 CONVERT_ARG_CHECKED(JSReceiver, obj, 0); 14890 CONVERT_ARG_CHECKED(JSReceiver, obj, 0);
14891 ASSERT(!obj->IsJSGlobalProxy() || !obj->map()->is_observed()); 14891 ASSERT(!obj->IsJSGlobalProxy() || !obj->map()->is_observed());
14892 return isolate->heap()->ToBoolean(obj->map()->is_observed()); 14892 return isolate->heap()->ToBoolean(obj->map()->is_observed());
14893 } 14893 }
14894 14894
14895 14895
14896 RUNTIME_FUNCTION(Runtime_SetIsObserved) { 14896 RUNTIME_FUNCTION(Runtime_SetIsObserved) {
14897 HandleScope scope(isolate); 14897 HandleScope scope(isolate);
14898 ASSERT(args.length() == 1); 14898 ASSERT(args.length() == 1);
14899 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); 14899 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
14900 ASSERT(!obj->IsJSGlobalProxy()); 14900 RUNTIME_ASSERT(!obj->IsJSGlobalProxy());
14901 if (obj->IsJSProxy()) 14901 if (obj->IsJSProxy()) return isolate->heap()->undefined_value();
14902 return isolate->heap()->undefined_value(); 14902 RUNTIME_ASSERT(!obj->map()->is_observed());
14903 14903
14904 ASSERT(obj->IsJSObject()); 14904 ASSERT(obj->IsJSObject());
14905 JSObject::SetObserved(Handle<JSObject>::cast(obj)); 14905 JSObject::SetObserved(Handle<JSObject>::cast(obj));
14906 return isolate->heap()->undefined_value(); 14906 return isolate->heap()->undefined_value();
14907 } 14907 }
14908 14908
14909 14909
14910 RUNTIME_FUNCTION(Runtime_SetMicrotaskPending) { 14910 RUNTIME_FUNCTION(Runtime_SetMicrotaskPending) {
14911 SealHandleScope shs(isolate); 14911 SealHandleScope shs(isolate);
14912 ASSERT(args.length() == 1); 14912 ASSERT(args.length() == 1);
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
15258 } 15258 }
15259 return NULL; 15259 return NULL;
15260 } 15260 }
15261 15261
15262 15262
15263 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15263 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15264 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15264 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15265 } 15265 }
15266 15266
15267 } } // namespace v8::internal 15267 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es7/object-observe-runtime.js » ('j') | test/mjsunit/es7/object-observe-runtime.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698