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

Unified Diff: src/runtime.cc

Issue 12213012: Split AccessorInfo into DeclaredAccessorInfo and ExecutableAccessorInfo (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« src/property.h ('K') | « src/property.h ('k') | src/stub-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index d8623f8ce9b5376ba082bd0da79ff3ddcd3a3403..8467c49fba844d19910090fb39c496366428e14d 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -981,15 +981,19 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInPrototypeChain) {
static bool CheckAccessException(Object* callback,
v8::AccessType access_type) {
- if (callback->IsAccessorInfo()) {
- AccessorInfo* info = AccessorInfo::cast(callback);
- return
- (access_type == v8::ACCESS_HAS &&
- (info->all_can_read() || info->all_can_write())) ||
- (access_type == v8::ACCESS_GET && info->all_can_read()) ||
- (access_type == v8::ACCESS_SET && info->all_can_write());
+ AccessorInfo* info = 0;
Sven Panne 2013/02/07 10:01:03 Again, this should stay as it is.
+ if (callback->IsExecutableAccessorInfo()) {
+ info = ExecutableAccessorInfo::cast(callback);
+ } else if (callback->IsDeclaredAccessorInfo()) {
+ info = DeclaredAccessorInfo::cast(callback);
+ } else {
+ return false;
}
- return false;
+ return
+ (access_type == v8::ACCESS_HAS &&
+ (info->all_can_read() || info->all_can_write())) ||
+ (access_type == v8::ACCESS_GET && info->all_can_read()) ||
+ (access_type == v8::ACCESS_SET && info->all_can_write());
}
@@ -4111,7 +4115,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineDataProperty) {
// To be compatible with Safari we do not change the value on API objects
// in Object.defineProperty(). Firefox disagrees here, and actually changes
// the value.
- if (callback->IsAccessorInfo()) {
+ if (callback->IsExecutableAccessorInfo() ||
Sven Panne 2013/02/07 10:01:03 See comment above.
+ callback->IsDeclaredAccessorInfo()) {
return isolate->heap()->undefined_value();
}
// Avoid redefining foreign callback as data property, just use the stored
@@ -10148,7 +10153,9 @@ static MaybeObject* DebugLookupResultValue(Heap* heap,
return result->GetConstantFunction();
case CALLBACKS: {
Object* structure = result->GetCallbackObject();
- if (structure->IsForeign() || structure->IsAccessorInfo()) {
+ if (structure->IsForeign() ||
Sven Panne 2013/02/07 10:01:03 See comment above.
+ structure->IsExecutableAccessorInfo() ||
+ structure->IsDeclaredAccessorInfo()) {
MaybeObject* maybe_value = result->holder()->GetPropertyWithCallback(
receiver, structure, name);
if (!maybe_value->ToObject(&value)) {
« src/property.h ('K') | « src/property.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698