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

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: Fixed lint 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
« no previous file with comments | « no previous file | test/mjsunit/es7/object-observe-runtime.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 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 14837 matching lines...) Expand 10 before | Expand all | Expand 10 after
14848 CONVERT_ARG_CHECKED(JSReceiver, obj, 0); 14848 CONVERT_ARG_CHECKED(JSReceiver, obj, 0);
14849 ASSERT(!obj->IsJSGlobalProxy() || !obj->map()->is_observed()); 14849 ASSERT(!obj->IsJSGlobalProxy() || !obj->map()->is_observed());
14850 return isolate->heap()->ToBoolean(obj->map()->is_observed()); 14850 return isolate->heap()->ToBoolean(obj->map()->is_observed());
14851 } 14851 }
14852 14852
14853 14853
14854 RUNTIME_FUNCTION(Runtime_SetIsObserved) { 14854 RUNTIME_FUNCTION(Runtime_SetIsObserved) {
14855 HandleScope scope(isolate); 14855 HandleScope scope(isolate);
14856 ASSERT(args.length() == 1); 14856 ASSERT(args.length() == 1);
14857 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); 14857 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
14858 ASSERT(!obj->IsJSGlobalProxy()); 14858 RUNTIME_ASSERT(!obj->IsJSGlobalProxy());
14859 if (obj->IsJSProxy()) 14859 if (obj->IsJSProxy()) return isolate->heap()->undefined_value();
14860 return isolate->heap()->undefined_value(); 14860 RUNTIME_ASSERT(!obj->map()->is_observed());
14861 14861
14862 ASSERT(obj->IsJSObject()); 14862 ASSERT(obj->IsJSObject());
14863 JSObject::SetObserved(Handle<JSObject>::cast(obj)); 14863 JSObject::SetObserved(Handle<JSObject>::cast(obj));
14864 return isolate->heap()->undefined_value(); 14864 return isolate->heap()->undefined_value();
14865 } 14865 }
14866 14866
14867 14867
14868 RUNTIME_FUNCTION(Runtime_SetMicrotaskPending) { 14868 RUNTIME_FUNCTION(Runtime_SetMicrotaskPending) {
14869 SealHandleScope shs(isolate); 14869 SealHandleScope shs(isolate);
14870 ASSERT(args.length() == 1); 14870 ASSERT(args.length() == 1);
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
15215 } 15215 }
15216 return NULL; 15216 return NULL;
15217 } 15217 }
15218 15218
15219 15219
15220 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15220 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15221 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15221 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15222 } 15222 }
15223 15223
15224 } } // namespace v8::internal 15224 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es7/object-observe-runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698