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

Side by Side Diff: src/api.cc

Issue 321543004: Rewrite GetPropertyAttribute to use the LookupIterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove bogus asserts Created 6 years, 6 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 | src/contexts.cc » ('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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 3111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3122 } 3122 }
3123 3123
3124 3124
3125 Local<Value> v8::Object::GetPrivate(v8::Handle<Private> key) { 3125 Local<Value> v8::Object::GetPrivate(v8::Handle<Private> key) {
3126 return Get(v8::Handle<Value>(reinterpret_cast<Value*>(*key))); 3126 return Get(v8::Handle<Value>(reinterpret_cast<Value*>(*key)));
3127 } 3127 }
3128 3128
3129 3129
3130 PropertyAttribute v8::Object::GetPropertyAttributes(v8::Handle<Value> key) { 3130 PropertyAttribute v8::Object::GetPropertyAttributes(v8::Handle<Value> key) {
3131 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3131 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3132 ON_BAILOUT(isolate, "v8::Object::GetPropertyAttribute()", 3132 ON_BAILOUT(isolate, "v8::Object::GetPropertyAttributes()",
3133 return static_cast<PropertyAttribute>(NONE)); 3133 return static_cast<PropertyAttribute>(NONE));
3134 ENTER_V8(isolate); 3134 ENTER_V8(isolate);
3135 i::HandleScope scope(isolate); 3135 i::HandleScope scope(isolate);
3136 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3136 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3137 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); 3137 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
3138 if (!key_obj->IsName()) { 3138 if (!key_obj->IsName()) {
3139 EXCEPTION_PREAMBLE(isolate); 3139 EXCEPTION_PREAMBLE(isolate);
3140 has_pending_exception = !i::Execution::ToString( 3140 has_pending_exception = !i::Execution::ToString(
3141 isolate, key_obj).ToHandle(&key_obj); 3141 isolate, key_obj).ToHandle(&key_obj);
3142 EXCEPTION_BAILOUT_CHECK(isolate, static_cast<PropertyAttribute>(NONE)); 3142 EXCEPTION_BAILOUT_CHECK(isolate, static_cast<PropertyAttribute>(NONE));
3143 } 3143 }
3144 i::Handle<i::Name> key_name = i::Handle<i::Name>::cast(key_obj); 3144 i::Handle<i::Name> key_name = i::Handle<i::Name>::cast(key_obj);
3145 PropertyAttributes result = 3145 PropertyAttributes result =
3146 i::JSReceiver::GetPropertyAttribute(self, key_name); 3146 i::JSReceiver::GetPropertyAttributes(self, key_name);
3147 if (result == ABSENT) return static_cast<PropertyAttribute>(NONE); 3147 if (result == ABSENT) return static_cast<PropertyAttribute>(NONE);
3148 return static_cast<PropertyAttribute>(result); 3148 return static_cast<PropertyAttribute>(result);
3149 } 3149 }
3150 3150
3151 3151
3152 Local<Value> v8::Object::GetPrototype() { 3152 Local<Value> v8::Object::GetPrototype() {
3153 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3153 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3154 ON_BAILOUT(isolate, "v8::Object::GetPrototype()", return Local<v8::Value>()); 3154 ON_BAILOUT(isolate, "v8::Object::GetPrototype()", return Local<v8::Value>());
3155 ENTER_V8(isolate); 3155 ENTER_V8(isolate);
3156 i::Handle<i::Object> self = Utils::OpenHandle(this); 3156 i::Handle<i::Object> self = Utils::OpenHandle(this);
(...skipping 4422 matching lines...) Expand 10 before | Expand all | Expand 10 after
7579 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7579 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7580 Address callback_address = 7580 Address callback_address =
7581 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7581 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7582 VMState<EXTERNAL> state(isolate); 7582 VMState<EXTERNAL> state(isolate);
7583 ExternalCallbackScope call_scope(isolate, callback_address); 7583 ExternalCallbackScope call_scope(isolate, callback_address);
7584 callback(info); 7584 callback(info);
7585 } 7585 }
7586 7586
7587 7587
7588 } } // namespace v8::internal 7588 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/contexts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698