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

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

Issue 1221303019: Fix keyed access of primitive objects in the runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years, 5 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-array.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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 309 // TODO(verwaest): Make sure DebugGetProperty can handle arrays, and remove
310 // this special case. 310 // this special case.
311 if (name->AsArrayIndex(&index)) { 311 if (name->AsArrayIndex(&index)) {
312 Handle<FixedArray> details = isolate->factory()->NewFixedArray(2); 312 Handle<FixedArray> details = isolate->factory()->NewFixedArray(2);
313 Handle<Object> element_or_char; 313 Handle<Object> element_or_char;
314 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 314 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, element_or_char,
315 isolate, element_or_char, 315 Object::GetElement(isolate, obj, index));
316 Runtime::GetElementOrCharAt(isolate, obj, index));
317 details->set(0, *element_or_char); 316 details->set(0, *element_or_char);
318 details->set(1, PropertyDetails::Empty().AsSmi()); 317 details->set(1, PropertyDetails::Empty().AsSmi());
319 return *isolate->factory()->NewJSArrayWithElements(details); 318 return *isolate->factory()->NewJSArrayWithElements(details);
320 } 319 }
321 320
322 LookupIterator it(obj, name, LookupIterator::HIDDEN); 321 LookupIterator it(obj, name, LookupIterator::HIDDEN);
323 bool has_caught = false; 322 bool has_caught = false;
324 Handle<Object> value = DebugGetProperty(&it, &has_caught); 323 Handle<Object> value = DebugGetProperty(&it, &has_caught);
325 if (!it.IsFound()) return isolate->heap()->undefined_value(); 324 if (!it.IsFound()) return isolate->heap()->undefined_value();
326 325
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1859 // If our frame is a top frame and we are stepping, we can do step-in 1858 // If our frame is a top frame and we are stepping, we can do step-in
1860 // at this place. 1859 // at this place.
1861 accept = additional_frame_it.frame()->id() == id; 1860 accept = additional_frame_it.frame()->id() == id;
1862 } 1861 }
1863 } 1862 }
1864 if (accept) { 1863 if (accept) {
1865 if (location.IsStepInLocation()) { 1864 if (location.IsStepInLocation()) {
1866 Smi* position_value = Smi::FromInt(location.position()); 1865 Smi* position_value = Smi::FromInt(location.position());
1867 RETURN_FAILURE_ON_EXCEPTION( 1866 RETURN_FAILURE_ON_EXCEPTION(
1868 isolate, 1867 isolate,
1869 JSObject::SetElement(array, index, handle(position_value, isolate), 1868 Object::SetElement(isolate, array, index,
1870 SLOPPY)); 1869 handle(position_value, isolate), SLOPPY));
1871 index++; 1870 index++;
1872 } 1871 }
1873 } 1872 }
1874 } 1873 }
1875 return *array; 1874 return *array;
1876 } 1875 }
1877 1876
1878 1877
1879 static const int kScopeDetailsTypeIndex = 0; 1878 static const int kScopeDetailsTypeIndex = 0;
1880 static const int kScopeDetailsObjectIndex = 1; 1879 static const int kScopeDetailsObjectIndex = 1;
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
3222 return *isolate->factory()->undefined_value(); 3221 return *isolate->factory()->undefined_value();
3223 } 3222 }
3224 3223
3225 3224
3226 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 3225 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
3227 UNIMPLEMENTED(); 3226 UNIMPLEMENTED();
3228 return NULL; 3227 return NULL;
3229 } 3228 }
3230 } // namespace internal 3229 } // namespace internal
3231 } // namespace v8 3230 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698