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

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

Issue 10382055: Array index computation dehoisting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplified expression. Created 8 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 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 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); 1951 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input));
1952 } 1952 }
1953 1953
1954 1954
1955 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( 1955 LInstruction* LChunkBuilder::DoLoadKeyedFastElement(
1956 HLoadKeyedFastElement* instr) { 1956 HLoadKeyedFastElement* instr) {
1957 ASSERT(instr->representation().IsTagged()); 1957 ASSERT(instr->representation().IsTagged());
1958 ASSERT(instr->key()->representation().IsInteger32()); 1958 ASSERT(instr->key()->representation().IsInteger32());
1959 LOperand* obj = UseRegisterAtStart(instr->object()); 1959 LOperand* obj = UseRegisterAtStart(instr->object());
1960 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 1960 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
1961 LLoadKeyedFastElement* result = new(zone()) LLoadKeyedFastElement(obj, key); 1961 LLoadKeyedFastElement* result =
Jakob Kummerow 2012/05/15 15:53:23 nit: why this change?
1962 new(zone()) LLoadKeyedFastElement(obj, key);
1962 if (instr->RequiresHoleCheck()) AssignEnvironment(result); 1963 if (instr->RequiresHoleCheck()) AssignEnvironment(result);
1963 return DefineAsRegister(result); 1964 return DefineAsRegister(result);
1964 } 1965 }
1965 1966
1966 1967
1967 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( 1968 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement(
1968 HLoadKeyedFastDoubleElement* instr) { 1969 HLoadKeyedFastDoubleElement* instr) {
1969 ASSERT(instr->representation().IsDouble()); 1970 ASSERT(instr->representation().IsDouble());
1970 ASSERT(instr->key()->representation().IsInteger32()); 1971 ASSERT(instr->key()->representation().IsInteger32());
1971 LOperand* elements = UseRegisterAtStart(instr->elements()); 1972 LOperand* elements = UseRegisterAtStart(instr->elements());
(...skipping 11 matching lines...) Expand all
1983 (instr->representation().IsInteger32() && 1984 (instr->representation().IsInteger32() &&
1984 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && 1985 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) &&
1985 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || 1986 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) ||
1986 (instr->representation().IsDouble() && 1987 (instr->representation().IsDouble() &&
1987 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || 1988 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) ||
1988 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); 1989 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS))));
1989 ASSERT(instr->key()->representation().IsInteger32()); 1990 ASSERT(instr->key()->representation().IsInteger32());
1990 LOperand* external_pointer = UseRegister(instr->external_pointer()); 1991 LOperand* external_pointer = UseRegister(instr->external_pointer());
1991 LOperand* key = UseRegisterOrConstant(instr->key()); 1992 LOperand* key = UseRegisterOrConstant(instr->key());
1992 LLoadKeyedSpecializedArrayElement* result = 1993 LLoadKeyedSpecializedArrayElement* result =
1993 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, 1994 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, key);
1994 key);
1995 LInstruction* load_instr = DefineAsRegister(result); 1995 LInstruction* load_instr = DefineAsRegister(result);
1996 // An unsigned int array load might overflow and cause a deopt, make sure it 1996 // An unsigned int array load might overflow and cause a deopt, make sure it
1997 // has an environment. 1997 // has an environment.
1998 return (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS) 1998 return (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS)
1999 ? AssignEnvironment(load_instr) 1999 ? AssignEnvironment(load_instr)
2000 : load_instr; 2000 : load_instr;
2001 } 2001 }
2002 2002
2003 2003
2004 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { 2004 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2431 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2432 LOperand* object = UseRegister(instr->object()); 2432 LOperand* object = UseRegister(instr->object());
2433 LOperand* index = UseTempRegister(instr->index()); 2433 LOperand* index = UseTempRegister(instr->index());
2434 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2434 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2435 } 2435 }
2436 2436
2437 2437
2438 } } // namespace v8::internal 2438 } } // namespace v8::internal
2439 2439
2440 #endif // V8_TARGET_ARCH_IA32 2440 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698