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

Side by Side Diff: src/x64/stub-cache-x64.cc

Issue 11365221: Allow property indexes to refer to slots inside the object header. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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/property.h ('K') | « src/stub-cache.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 // 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 343 }
344 344
345 345
346 // Load a fast property out of a holder object (src). In-object properties 346 // Load a fast property out of a holder object (src). In-object properties
347 // are loaded directly otherwise the property is loaded from the properties 347 // are loaded directly otherwise the property is loaded from the properties
348 // fixed array. 348 // fixed array.
349 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, 349 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
350 Register dst, 350 Register dst,
351 Register src, 351 Register src,
352 Handle<JSObject> holder, 352 Handle<JSObject> holder,
353 int index) { 353 PropertyIndex index) {
354 // Adjust for the number of properties stored in the holder. 354 if (index.IsHeaderIndex()) {
355 index -= holder->map()->inobject_properties(); 355 int offset = index.HeaderIndex() * kPointerSize;
356 if (index < 0) {
357 // Get the property straight out of the holder.
358 int offset = holder->map()->instance_size() + (index * kPointerSize);
359 __ movq(dst, FieldOperand(src, offset)); 356 __ movq(dst, FieldOperand(src, offset));
360 } else { 357 } else {
361 // Calculate the offset into the properties array. 358 // Adjust for the number of properties stored in the holder.
362 int offset = index * kPointerSize + FixedArray::kHeaderSize; 359 int slot = index.FieldIndex() - holder->map()->inobject_properties();
363 __ movq(dst, FieldOperand(src, JSObject::kPropertiesOffset)); 360 if (slot < 0) {
364 __ movq(dst, FieldOperand(dst, offset)); 361 // Get the property straight out of the holder.
362 int offset = holder->map()->instance_size() + (slot * kPointerSize);
363 __ movq(dst, FieldOperand(src, offset));
364 } else {
365 // Calculate the offset into the properties array.
366 int offset = slot * kPointerSize + FixedArray::kHeaderSize;
367 __ movq(dst, FieldOperand(src, JSObject::kPropertiesOffset));
368 __ movq(dst, FieldOperand(dst, offset));
369 }
365 } 370 }
366 } 371 }
367 372
368 373
369 static void PushInterceptorArguments(MacroAssembler* masm, 374 static void PushInterceptorArguments(MacroAssembler* masm,
370 Register receiver, 375 Register receiver,
371 Register holder, 376 Register holder,
372 Register name, 377 Register name,
373 Handle<JSObject> holder_obj) { 378 Handle<JSObject> holder_obj) {
374 __ push(name); 379 __ push(name);
(...skipping 3725 matching lines...) Expand 10 before | Expand all | Expand 10 after
4100 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 4105 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4101 } 4106 }
4102 } 4107 }
4103 4108
4104 4109
4105 #undef __ 4110 #undef __
4106 4111
4107 } } // namespace v8::internal 4112 } } // namespace v8::internal
4108 4113
4109 #endif // V8_TARGET_ARCH_X64 4114 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/property.h ('K') | « src/stub-cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698