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

Side by Side Diff: src/x64/codegen-x64.cc

Issue 3141022: Using array index hash code for string-to-number conversion. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 3 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/x64/codegen-x64.h ('k') | src/x64/full-codegen-x64.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 7205 matching lines...) Expand 10 before | Expand all | Expand 10 after
7216 Immediate(JS_REGEXP_TYPE)); 7216 Immediate(JS_REGEXP_TYPE));
7217 destination()->false_target()->Branch(not_equal); 7217 destination()->false_target()->Branch(not_equal);
7218 __ cmpq(tmp, FieldOperand(right, HeapObject::kMapOffset)); 7218 __ cmpq(tmp, FieldOperand(right, HeapObject::kMapOffset));
7219 destination()->false_target()->Branch(not_equal); 7219 destination()->false_target()->Branch(not_equal);
7220 __ movq(tmp, FieldOperand(left, JSRegExp::kDataOffset)); 7220 __ movq(tmp, FieldOperand(left, JSRegExp::kDataOffset));
7221 __ cmpq(tmp, FieldOperand(right, JSRegExp::kDataOffset)); 7221 __ cmpq(tmp, FieldOperand(right, JSRegExp::kDataOffset));
7222 destination()->Split(equal); 7222 destination()->Split(equal);
7223 } 7223 }
7224 7224
7225 7225
7226 void CodeGenerator::GenerateHasCachedArrayIndex(ZoneList<Expression*>* args) {
7227 ASSERT(args->length() == 1);
7228 Load(args->at(0));
7229 Result value = frame_->Pop();
7230 value.ToRegister();
7231 ASSERT(value.is_valid());
7232 __ testl(FieldOperand(value.reg(), String::kHashFieldOffset),
7233 Immediate(String::kContainsCachedArrayIndexMask));
7234 value.Unuse();
7235 destination()->Split(zero);
7236 }
7237
7238
7239 void CodeGenerator::GenerateGetCachedArrayIndex(ZoneList<Expression*>* args) {
7240 ASSERT(args->length() == 1);
7241 Load(args->at(0));
7242 Result string = frame_->Pop();
7243 string.ToRegister();
7244
7245 Result number = allocator()->Allocate();
7246 ASSERT(number.is_valid());
7247 __ movl(number.reg(), FieldOperand(string.reg(), String::kHashFieldOffset));
7248 __ IndexFromHash(number.reg(), number.reg());
7249 string.Unuse();
7250 frame_->Push(&number);
7251 }
7252
7253
7226 void CodeGenerator::VisitCallRuntime(CallRuntime* node) { 7254 void CodeGenerator::VisitCallRuntime(CallRuntime* node) {
7227 if (CheckForInlineRuntimeCall(node)) { 7255 if (CheckForInlineRuntimeCall(node)) {
7228 return; 7256 return;
7229 } 7257 }
7230 7258
7231 ZoneList<Expression*>* args = node->arguments(); 7259 ZoneList<Expression*>* args = node->arguments();
7232 Comment cmnt(masm_, "[ CallRuntime"); 7260 Comment cmnt(masm_, "[ CallRuntime");
7233 Runtime::Function* function = node->function(); 7261 Runtime::Function* function = node->function();
7234 7262
7235 if (function == NULL) { 7263 if (function == NULL) {
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after
8872 #undef __ 8900 #undef __
8873 8901
8874 void RecordWriteStub::Generate(MacroAssembler* masm) { 8902 void RecordWriteStub::Generate(MacroAssembler* masm) {
8875 masm->RecordWriteHelper(object_, addr_, scratch_); 8903 masm->RecordWriteHelper(object_, addr_, scratch_);
8876 masm->ret(0); 8904 masm->ret(0);
8877 } 8905 }
8878 8906
8879 } } // namespace v8::internal 8907 } } // namespace v8::internal
8880 8908
8881 #endif // V8_TARGET_ARCH_X64 8909 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698