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

Side by Side Diff: src/virtual-frame.cc

Issue 113455: Clean up the Result class. Reduce the size of Result from four words... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 7 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 void VirtualFrame::SetElementAt(int index, Result* value) { 318 void VirtualFrame::SetElementAt(int index, Result* value) {
319 int frame_index = elements_.length() - index - 1; 319 int frame_index = elements_.length() - index - 1;
320 ASSERT(frame_index >= 0); 320 ASSERT(frame_index >= 0);
321 ASSERT(frame_index < elements_.length()); 321 ASSERT(frame_index < elements_.length());
322 ASSERT(value->is_valid()); 322 ASSERT(value->is_valid());
323 FrameElement original = elements_[frame_index]; 323 FrameElement original = elements_[frame_index];
324 324
325 // Early exit if the element is the same as the one being set. 325 // Early exit if the element is the same as the one being set.
326 bool same_register = original.is_register() 326 bool same_register = original.is_register()
327 && value->is_register() 327 && value->is_register()
328 && original.reg().is(value->reg()); 328 && original.reg().is(value->reg());
329 bool same_constant = original.is_constant() 329 bool same_constant = original.is_constant()
330 && value->is_constant() 330 && value->is_constant()
331 && original.handle().is_identical_to(value->handle()); 331 && original.handle().is_identical_to(value->handle());
332 if (same_register || same_constant) { 332 if (same_register || same_constant) {
333 value->Unuse(); 333 value->Unuse();
334 return; 334 return;
335 } 335 }
336 336
337 InvalidateFrameSlotAt(frame_index); 337 InvalidateFrameSlotAt(frame_index);
338 338
339 FrameElement new_element; 339 FrameElement new_element;
340 if (value->is_register()) { 340 if (value->is_register()) {
341 if (is_used(value->reg())) { 341 if (is_used(value->reg())) {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 // Specialization of List::ResizeAdd to non-inlined version for FrameElements. 470 // Specialization of List::ResizeAdd to non-inlined version for FrameElements.
471 // The function ResizeAdd becomes a real function, whose implementation is the 471 // The function ResizeAdd becomes a real function, whose implementation is the
472 // inlined ResizeAddInternal. 472 // inlined ResizeAddInternal.
473 template <> 473 template <>
474 void List<FrameElement, 474 void List<FrameElement,
475 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element) { 475 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element) {
476 ResizeAddInternal(element); 476 ResizeAddInternal(element);
477 } 477 }
478 478
479 } } // namespace v8::internal 479 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698