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

Side by Side Diff: src/accessors.cc

Issue 1413463006: Map v8::Object to v8::internal::JSReceiver (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 1 month 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 | « no previous file | src/api.h » ('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 "src/accessors.h" 5 #include "src/accessors.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/contexts.h" 8 #include "src/contexts.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 Object* result = isolate->native_context()->array_values_iterator(); 154 Object* result = isolate->native_context()->array_values_iterator();
155 info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(result, isolate))); 155 info.GetReturnValue().Set(Utils::ToLocal(Handle<Object>(result, isolate)));
156 } 156 }
157 157
158 158
159 void Accessors::ArgumentsIteratorSetter( 159 void Accessors::ArgumentsIteratorSetter(
160 v8::Local<v8::Name> name, v8::Local<v8::Value> val, 160 v8::Local<v8::Name> name, v8::Local<v8::Value> val,
161 const v8::PropertyCallbackInfo<void>& info) { 161 const v8::PropertyCallbackInfo<void>& info) {
162 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); 162 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
163 HandleScope scope(isolate); 163 HandleScope scope(isolate);
164 Handle<JSObject> object_handle = Utils::OpenHandle(*info.This()); 164 Handle<JSObject> object_handle =
165 Handle<JSObject>::cast(Utils::OpenHandle(*info.This()));
165 Handle<Object> value_handle = Utils::OpenHandle(*val); 166 Handle<Object> value_handle = Utils::OpenHandle(*val);
166 Handle<Name> name_handle = Utils::OpenHandle(*name); 167 Handle<Name> name_handle = Utils::OpenHandle(*name);
167 168
168 if (JSObject::DefinePropertyOrElementIgnoreAttributes( 169 if (JSObject::DefinePropertyOrElementIgnoreAttributes(
169 object_handle, name_handle, value_handle, NONE) 170 object_handle, name_handle, value_handle, NONE)
170 .is_null()) { 171 .is_null()) {
171 isolate->OptionalRescheduleException(false); 172 isolate->OptionalRescheduleException(false);
172 } 173 }
173 } 174 }
174 175
(...skipping 23 matching lines...) Expand all
198 } 199 }
199 200
200 201
201 void Accessors::ArrayLengthSetter( 202 void Accessors::ArrayLengthSetter(
202 v8::Local<v8::Name> name, 203 v8::Local<v8::Name> name,
203 v8::Local<v8::Value> val, 204 v8::Local<v8::Value> val,
204 const v8::PropertyCallbackInfo<void>& info) { 205 const v8::PropertyCallbackInfo<void>& info) {
205 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); 206 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
206 HandleScope scope(isolate); 207 HandleScope scope(isolate);
207 208
208 Handle<JSObject> object = Utils::OpenHandle(*info.This()); 209 Handle<JSReceiver> object = Utils::OpenHandle(*info.This());
209 Handle<JSArray> array = Handle<JSArray>::cast(object); 210 Handle<JSArray> array = Handle<JSArray>::cast(object);
210 Handle<Object> length_obj = Utils::OpenHandle(*val); 211 Handle<Object> length_obj = Utils::OpenHandle(*val);
211 212
212 uint32_t length = 0; 213 uint32_t length = 0;
213 if (!JSArray::AnythingToArrayLength(isolate, length_obj, &length)) { 214 if (!JSArray::AnythingToArrayLength(isolate, length_obj, &length)) {
214 isolate->OptionalRescheduleException(false); 215 isolate->OptionalRescheduleException(false);
215 return; 216 return;
216 } 217 }
217 218
218 if (JSArray::ObservableSetLength(array, length).is_null()) { 219 if (JSArray::ObservableSetLength(array, length).is_null()) {
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1468 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1468 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1469 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1469 info->set_getter(*getter); 1470 info->set_getter(*getter);
1470 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1471 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1471 return info; 1472 return info;
1472 } 1473 }
1473 1474
1474 1475
1475 } // namespace internal 1476 } // namespace internal
1476 } // namespace v8 1477 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698