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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 10697015: Separating transitions from descriptors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Using WhitenessWitness in TransitionArray code. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ic.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 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 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after
2403 } 2403 }
2404 } 2404 }
2405 2405
2406 2406
2407 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, 2407 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result,
2408 Register object, 2408 Register object,
2409 Handle<Map> type, 2409 Handle<Map> type,
2410 Handle<String> name, 2410 Handle<String> name,
2411 LEnvironment* env) { 2411 LEnvironment* env) {
2412 LookupResult lookup(isolate()); 2412 LookupResult lookup(isolate());
2413 type->LookupInDescriptors(NULL, *name, &lookup); 2413 type->LookupTransitionOrDescriptor(NULL, *name, &lookup);
2414 ASSERT(lookup.IsFound() || lookup.IsCacheable()); 2414 ASSERT(lookup.IsFound() || lookup.IsCacheable());
2415 if (lookup.IsField()) { 2415 if (lookup.IsField()) {
2416 int index = lookup.GetLocalFieldIndexFromMap(*type); 2416 int index = lookup.GetLocalFieldIndexFromMap(*type);
2417 int offset = index * kPointerSize; 2417 int offset = index * kPointerSize;
2418 if (index < 0) { 2418 if (index < 0) {
2419 // Negative property indices are in-object properties, indexed 2419 // Negative property indices are in-object properties, indexed
2420 // from the end of the fixed part of the object. 2420 // from the end of the fixed part of the object.
2421 __ mov(result, FieldOperand(object, offset + type->instance_size())); 2421 __ mov(result, FieldOperand(object, offset + type->instance_size()));
2422 } else { 2422 } else {
2423 // Non-negative property indices are in the properties array. 2423 // Non-negative property indices are in the properties array.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2464 2464
2465 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the 2465 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the
2466 // prototype chain, which causes unbounded code generation. 2466 // prototype chain, which causes unbounded code generation.
2467 static bool CompactEmit(SmallMapList* list, 2467 static bool CompactEmit(SmallMapList* list,
2468 Handle<String> name, 2468 Handle<String> name,
2469 int i, 2469 int i,
2470 Isolate* isolate) { 2470 Isolate* isolate) {
2471 Handle<Map> map = list->at(i); 2471 Handle<Map> map = list->at(i);
2472 // If the map has ElementsKind transitions, we will generate map checks 2472 // If the map has ElementsKind transitions, we will generate map checks
2473 // for each kind in __ CompareMap(..., ALLOW_ELEMENTS_TRANSITION_MAPS). 2473 // for each kind in __ CompareMap(..., ALLOW_ELEMENTS_TRANSITION_MAPS).
2474 if (map->elements_transition_map() != NULL) return false; 2474 if (map->HasElementsTransition()) return false;
2475 LookupResult lookup(isolate); 2475 LookupResult lookup(isolate);
2476 map->LookupInDescriptors(NULL, *name, &lookup); 2476 map->LookupDescriptor(NULL, *name, &lookup);
2477 return lookup.IsField() || lookup.IsConstantFunction(); 2477 return lookup.IsField() || lookup.IsConstantFunction();
2478 } 2478 }
2479 2479
2480 2480
2481 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { 2481 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) {
2482 Register object = ToRegister(instr->object()); 2482 Register object = ToRegister(instr->object());
2483 Register result = ToRegister(instr->result()); 2483 Register result = ToRegister(instr->result());
2484 2484
2485 int map_count = instr->hydrogen()->types()->length(); 2485 int map_count = instr->hydrogen()->types()->length();
2486 bool need_generic = instr->hydrogen()->need_generic(); 2486 bool need_generic = instr->hydrogen()->need_generic();
(...skipping 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after
5332 FixedArray::kHeaderSize - kPointerSize)); 5332 FixedArray::kHeaderSize - kPointerSize));
5333 __ bind(&done); 5333 __ bind(&done);
5334 } 5334 }
5335 5335
5336 5336
5337 #undef __ 5337 #undef __
5338 5338
5339 } } // namespace v8::internal 5339 } } // namespace v8::internal
5340 5340
5341 #endif // V8_TARGET_ARCH_IA32 5341 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698