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

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

Issue 1775973002: Add GetProperty/GetElement to JSReceiver and use it where possible (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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-i18n.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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/debug/debug-frames.h" 9 #include "src/debug/debug-frames.h"
10 #include "src/debug/liveedit.h" 10 #include "src/debug/liveedit.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 USE(new_shared_array); 207 USE(new_shared_array);
208 RUNTIME_ASSERT(old_shared_array->length()->IsSmi()); 208 RUNTIME_ASSERT(old_shared_array->length()->IsSmi());
209 RUNTIME_ASSERT(new_shared_array->length() == old_shared_array->length()); 209 RUNTIME_ASSERT(new_shared_array->length() == old_shared_array->length());
210 RUNTIME_ASSERT(old_shared_array->HasFastElements()); 210 RUNTIME_ASSERT(old_shared_array->HasFastElements());
211 RUNTIME_ASSERT(new_shared_array->HasFastElements()); 211 RUNTIME_ASSERT(new_shared_array->HasFastElements());
212 int array_length = Smi::cast(old_shared_array->length())->value(); 212 int array_length = Smi::cast(old_shared_array->length())->value();
213 for (int i = 0; i < array_length; i++) { 213 for (int i = 0; i < array_length; i++) {
214 Handle<Object> old_element; 214 Handle<Object> old_element;
215 Handle<Object> new_element; 215 Handle<Object> new_element;
216 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 216 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
217 isolate, old_element, Object::GetElement(isolate, old_shared_array, i)); 217 isolate, old_element,
218 JSReceiver::GetElement(isolate, old_shared_array, i));
218 RUNTIME_ASSERT( 219 RUNTIME_ASSERT(
219 old_element->IsJSValue() && 220 old_element->IsJSValue() &&
220 Handle<JSValue>::cast(old_element)->value()->IsSharedFunctionInfo()); 221 Handle<JSValue>::cast(old_element)->value()->IsSharedFunctionInfo());
221 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 222 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
222 isolate, new_element, Object::GetElement(isolate, new_shared_array, i)); 223 isolate, new_element,
224 JSReceiver::GetElement(isolate, new_shared_array, i));
223 RUNTIME_ASSERT( 225 RUNTIME_ASSERT(
224 new_element->IsUndefined() || 226 new_element->IsUndefined() ||
225 (new_element->IsJSValue() && 227 (new_element->IsJSValue() &&
226 Handle<JSValue>::cast(new_element)->value()->IsSharedFunctionInfo())); 228 Handle<JSValue>::cast(new_element)->value()->IsSharedFunctionInfo()));
227 } 229 }
228 230
229 return *LiveEdit::CheckAndDropActivations(old_shared_array, new_shared_array, 231 return *LiveEdit::CheckAndDropActivations(old_shared_array, new_shared_array,
230 do_drop); 232 do_drop);
231 } 233 }
232 234
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // We don't really care what the inlined frame index is, since we are 280 // We don't really care what the inlined frame index is, since we are
279 // throwing away the entire frame anyways. 281 // throwing away the entire frame anyways.
280 const char* error_message = LiveEdit::RestartFrame(it.frame()); 282 const char* error_message = LiveEdit::RestartFrame(it.frame());
281 if (error_message) { 283 if (error_message) {
282 return *(isolate->factory()->InternalizeUtf8String(error_message)); 284 return *(isolate->factory()->InternalizeUtf8String(error_message));
283 } 285 }
284 return heap->true_value(); 286 return heap->true_value();
285 } 287 }
286 } // namespace internal 288 } // namespace internal
287 } // namespace v8 289 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-i18n.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698