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

Side by Side Diff: src/objects.cc

Issue 466283003: Use LookupIterator for CompileLoadInterceptor and delete Object::Lookup (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add ports Created 6 years, 4 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 const Object* fun = this; 97 const Object* fun = this;
98 while (fun->IsJSFunctionProxy()) { 98 while (fun->IsJSFunctionProxy()) {
99 fun = JSFunctionProxy::cast(fun)->call_trap(); 99 fun = JSFunctionProxy::cast(fun)->call_trap();
100 } 100 }
101 return fun->IsJSFunction() || 101 return fun->IsJSFunction() ||
102 (fun->IsHeapObject() && 102 (fun->IsHeapObject() &&
103 HeapObject::cast(fun)->map()->has_instance_call_handler()); 103 HeapObject::cast(fun)->map()->has_instance_call_handler());
104 } 104 }
105 105
106 106
107 void Object::Lookup(Handle<Name> name, LookupResult* result) {
108 DisallowHeapAllocation no_gc;
109 Object* holder = NULL;
110 if (IsJSReceiver()) {
111 holder = this;
112 } else {
113 Context* native_context = result->isolate()->context()->native_context();
114 if (IsNumber()) {
115 holder = native_context->number_function()->instance_prototype();
116 } else if (IsString()) {
117 holder = native_context->string_function()->instance_prototype();
118 } else if (IsSymbol()) {
119 holder = native_context->symbol_function()->instance_prototype();
120 } else if (IsBoolean()) {
121 holder = native_context->boolean_function()->instance_prototype();
122 } else {
123 result->isolate()->PushStackTraceAndDie(
124 0xDEAD0000, this, JSReceiver::cast(this)->map(), 0xDEAD0001);
125 }
126 }
127 DCHECK(holder != NULL); // Cannot handle null or undefined.
128 JSReceiver::cast(holder)->Lookup(name, result);
129 }
130
131
132 MaybeHandle<Object> Object::GetProperty(LookupIterator* it) { 107 MaybeHandle<Object> Object::GetProperty(LookupIterator* it) {
133 for (; it->IsFound(); it->Next()) { 108 for (; it->IsFound(); it->Next()) {
134 switch (it->state()) { 109 switch (it->state()) {
135 case LookupIterator::NOT_FOUND: 110 case LookupIterator::NOT_FOUND:
136 UNREACHABLE(); 111 UNREACHABLE();
137 case LookupIterator::JSPROXY: 112 case LookupIterator::JSPROXY:
138 return JSProxy::GetPropertyWithHandler(it->GetHolder<JSProxy>(), 113 return JSProxy::GetPropertyWithHandler(it->GetHolder<JSProxy>(),
139 it->GetReceiver(), it->name()); 114 it->GetReceiver(), it->name());
140 case LookupIterator::INTERCEPTOR: { 115 case LookupIterator::INTERCEPTOR: {
141 MaybeHandle<Object> maybe_result = JSObject::GetPropertyWithInterceptor( 116 MaybeHandle<Object> maybe_result = JSObject::GetPropertyWithInterceptor(
(...skipping 16538 matching lines...) Expand 10 before | Expand all | Expand 10 after
16680 #define ERROR_MESSAGES_TEXTS(C, T) T, 16655 #define ERROR_MESSAGES_TEXTS(C, T) T,
16681 static const char* error_messages_[] = { 16656 static const char* error_messages_[] = {
16682 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16657 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16683 }; 16658 };
16684 #undef ERROR_MESSAGES_TEXTS 16659 #undef ERROR_MESSAGES_TEXTS
16685 return error_messages_[reason]; 16660 return error_messages_[reason];
16686 } 16661 }
16687 16662
16688 16663
16689 } } // namespace v8::internal 16664 } } // namespace v8::internal
OLDNEW
« src/ia32/stub-cache-ia32.cc ('K') | « src/objects.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698