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

Side by Side Diff: src/runtime.cc

Issue 480283003: Minor LookupIterator cleanups (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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
« src/objects.h ('K') | « src/objects.cc ('k') | no next file » | 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 "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 10877 matching lines...) Expand 10 before | Expand all | Expand 10 after
10888 10888
10889 10889
10890 RUNTIME_FUNCTION(Runtime_Break) { 10890 RUNTIME_FUNCTION(Runtime_Break) {
10891 SealHandleScope shs(isolate); 10891 SealHandleScope shs(isolate);
10892 DCHECK(args.length() == 0); 10892 DCHECK(args.length() == 0);
10893 isolate->stack_guard()->RequestDebugBreak(); 10893 isolate->stack_guard()->RequestDebugBreak();
10894 return isolate->heap()->undefined_value(); 10894 return isolate->heap()->undefined_value();
10895 } 10895 }
10896 10896
10897 10897
10898 static Handle<Object> DebugLookupResultValue(LookupIterator* it, 10898 static Handle<Object> DebugGetProperty(LookupIterator* it,
10899 bool* has_caught = NULL) { 10899 bool* has_caught = NULL) {
10900 for (; it->IsFound(); it->Next()) { 10900 for (; it->IsFound(); it->Next()) {
10901 switch (it->state()) { 10901 switch (it->state()) {
10902 case LookupIterator::NOT_FOUND: 10902 case LookupIterator::NOT_FOUND:
10903 case LookupIterator::TRANSITION: 10903 case LookupIterator::TRANSITION:
10904 UNREACHABLE(); 10904 UNREACHABLE();
10905 case LookupIterator::ACCESS_CHECK: 10905 case LookupIterator::ACCESS_CHECK:
10906 // Ignore access checks. 10906 // Ignore access checks.
10907 break; 10907 break;
10908 case LookupIterator::INTERCEPTOR: 10908 case LookupIterator::INTERCEPTOR:
10909 case LookupIterator::JSPROXY: 10909 case LookupIterator::JSPROXY:
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
10975 isolate, element_or_char, 10975 isolate, element_or_char,
10976 Runtime::GetElementOrCharAt(isolate, obj, index)); 10976 Runtime::GetElementOrCharAt(isolate, obj, index));
10977 details->set(0, *element_or_char); 10977 details->set(0, *element_or_char);
10978 details->set( 10978 details->set(
10979 1, PropertyDetails(NONE, NORMAL, Representation::None()).AsSmi()); 10979 1, PropertyDetails(NONE, NORMAL, Representation::None()).AsSmi());
10980 return *isolate->factory()->NewJSArrayWithElements(details); 10980 return *isolate->factory()->NewJSArrayWithElements(details);
10981 } 10981 }
10982 10982
10983 LookupIterator it(obj, name, LookupIterator::CHECK_HIDDEN); 10983 LookupIterator it(obj, name, LookupIterator::CHECK_HIDDEN);
10984 bool has_caught = false; 10984 bool has_caught = false;
10985 Handle<Object> value = DebugLookupResultValue(&it, &has_caught); 10985 Handle<Object> value = DebugGetProperty(&it, &has_caught);
10986 if (!it.IsFound()) return isolate->heap()->undefined_value(); 10986 if (!it.IsFound()) return isolate->heap()->undefined_value();
10987 10987
10988 Handle<Object> maybe_pair; 10988 Handle<Object> maybe_pair;
10989 if (it.state() == LookupIterator::PROPERTY && 10989 if (it.state() == LookupIterator::PROPERTY &&
10990 it.property_kind() == LookupIterator::ACCESSOR) { 10990 it.property_kind() == LookupIterator::ACCESSOR) {
10991 maybe_pair = it.GetAccessors(); 10991 maybe_pair = it.GetAccessors();
10992 } 10992 }
10993 10993
10994 // If the callback object is a fixed array then it contains JavaScript 10994 // If the callback object is a fixed array then it contains JavaScript
10995 // getter and/or setter. 10995 // getter and/or setter.
(...skipping 19 matching lines...) Expand all
11015 11015
11016 RUNTIME_FUNCTION(Runtime_DebugGetProperty) { 11016 RUNTIME_FUNCTION(Runtime_DebugGetProperty) {
11017 HandleScope scope(isolate); 11017 HandleScope scope(isolate);
11018 11018
11019 DCHECK(args.length() == 2); 11019 DCHECK(args.length() == 2);
11020 11020
11021 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); 11021 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
11022 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 11022 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
11023 11023
11024 LookupIterator it(obj, name, LookupIterator::CHECK_DERIVED); 11024 LookupIterator it(obj, name, LookupIterator::CHECK_DERIVED);
11025 return *DebugLookupResultValue(&it); 11025 return *DebugGetProperty(&it);
11026 } 11026 }
11027 11027
11028 11028
11029 // Return the property type calculated from the property details. 11029 // Return the property type calculated from the property details.
11030 // args[0]: smi with property details. 11030 // args[0]: smi with property details.
11031 RUNTIME_FUNCTION(Runtime_DebugPropertyTypeFromDetails) { 11031 RUNTIME_FUNCTION(Runtime_DebugPropertyTypeFromDetails) {
11032 SealHandleScope shs(isolate); 11032 SealHandleScope shs(isolate);
11033 DCHECK(args.length() == 1); 11033 DCHECK(args.length() == 1);
11034 CONVERT_PROPERTY_DETAILS_CHECKED(details, 0); 11034 CONVERT_PROPERTY_DETAILS_CHECKED(details, 0);
11035 return Smi::FromInt(static_cast<int>(details.type())); 11035 return Smi::FromInt(static_cast<int>(details.type()));
(...skipping 4610 matching lines...) Expand 10 before | Expand all | Expand 10 after
15646 } 15646 }
15647 return NULL; 15647 return NULL;
15648 } 15648 }
15649 15649
15650 15650
15651 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15651 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15652 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15652 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15653 } 15653 }
15654 15654
15655 } } // namespace v8::internal 15655 } } // namespace v8::internal
OLDNEW
« src/objects.h ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698