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

Side by Side Diff: src/runtime/runtime-debug.cc

Issue 1178893002: Introduce LookupIterator::PropertyOrElement which converts name to index if possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/runtime/runtime-object.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/arguments.h" 8 #include "src/arguments.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/debug.h" 10 #include "src/debug.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // could have the assumption that its own native context is the current 299 // could have the assumption that its own native context is the current
300 // context and not some internal debugger context. 300 // context and not some internal debugger context.
301 SaveContext save(isolate); 301 SaveContext save(isolate);
302 if (isolate->debug()->in_debug_scope()) { 302 if (isolate->debug()->in_debug_scope()) {
303 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext()); 303 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext());
304 } 304 }
305 305
306 // Check if the name is trivially convertible to an index and get the element 306 // Check if the name is trivially convertible to an index and get the element
307 // if so. 307 // if so.
308 uint32_t index; 308 uint32_t index;
309 // TODO(verwaest): Make sure DebugGetProperty can handle arrays, and remove
310 // this special case.
309 if (name->AsArrayIndex(&index)) { 311 if (name->AsArrayIndex(&index)) {
310 Handle<FixedArray> details = isolate->factory()->NewFixedArray(2); 312 Handle<FixedArray> details = isolate->factory()->NewFixedArray(2);
311 Handle<Object> element_or_char; 313 Handle<Object> element_or_char;
312 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 314 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
313 isolate, element_or_char, 315 isolate, element_or_char,
314 Runtime::GetElementOrCharAt(isolate, obj, index)); 316 Runtime::GetElementOrCharAt(isolate, obj, index));
315 details->set(0, *element_or_char); 317 details->set(0, *element_or_char);
316 details->set(1, PropertyDetails::Empty().AsSmi()); 318 details->set(1, PropertyDetails::Empty().AsSmi());
317 return *isolate->factory()->NewJSArrayWithElements(details); 319 return *isolate->factory()->NewJSArrayWithElements(details);
318 } 320 }
(...skipping 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after
3178 return Smi::FromInt(isolate->debug()->is_active()); 3180 return Smi::FromInt(isolate->debug()->is_active());
3179 } 3181 }
3180 3182
3181 3183
3182 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 3184 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
3183 UNIMPLEMENTED(); 3185 UNIMPLEMENTED();
3184 return NULL; 3186 return NULL;
3185 } 3187 }
3186 } // namespace internal 3188 } // namespace internal
3187 } // namespace v8 3189 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698