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

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

Issue 437953003: Reuse the nonexistent handler frontend for transition handlers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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/stub-cache.cc ('k') | src/x87/stub-cache-x87.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 360
361 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, 361 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label,
362 Handle<Name> name) { 362 Handle<Name> name) {
363 if (!label->is_unused()) { 363 if (!label->is_unused()) {
364 __ bind(label); 364 __ bind(label);
365 __ Move(this->name(), name); 365 __ Move(this->name(), name);
366 } 366 }
367 } 367 }
368 368
369 369
370 void NamedStoreHandlerCompiler::GenerateNegativeHolderLookup(
371 Register holder_reg, Handle<Name> name, Label* miss) {
372 if (holder()->IsJSGlobalObject()) {
373 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(holder()),
374 name, scratch1(), miss);
375 } else if (!holder()->HasFastProperties()) {
376 GenerateDictionaryNegativeLookup(masm(), miss, holder_reg, name, scratch1(),
377 scratch2());
378 }
379 }
380
381
382 // Receiver_reg is preserved on jumps to miss_label, but may be destroyed if 370 // Receiver_reg is preserved on jumps to miss_label, but may be destroyed if
383 // store is successful. 371 // store is successful.
384 void NamedStoreHandlerCompiler::GenerateStoreTransition( 372 void NamedStoreHandlerCompiler::GenerateStoreTransition(
385 Handle<Map> transition, Handle<Name> name, Register receiver_reg, 373 Handle<Map> transition, Handle<Name> name, Register receiver_reg,
386 Register storage_reg, Register value_reg, Register scratch1, 374 Register storage_reg, Register value_reg, Register scratch1,
387 Register scratch2, Register unused, Label* miss_label, Label* slow) { 375 Register scratch2, Register unused, Label* miss_label, Label* slow) {
388 int descriptor = transition->LastAdded(); 376 int descriptor = transition->LastAdded();
389 DescriptorArray* descriptors = transition->instance_descriptors(); 377 DescriptorArray* descriptors = transition->instance_descriptors();
390 PropertyDetails details = descriptors->GetDetails(descriptor); 378 PropertyDetails details = descriptors->GetDetails(descriptor);
391 Representation representation = details.representation(); 379 Representation representation = details.representation();
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 1062
1075 __ bind(&miss); 1063 __ bind(&miss);
1076 1064
1077 TailCallBuiltin(masm(), MissBuiltin(kind())); 1065 TailCallBuiltin(masm(), MissBuiltin(kind()));
1078 1066
1079 // Return the generated code. 1067 // Return the generated code.
1080 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); 1068 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
1081 } 1069 }
1082 1070
1083 1071
1084 Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent(
1085 Handle<Name> name) {
1086 NonexistentFrontend(name);
1087
1088 // Return undefined if maps of the full prototype chain are still the
1089 // same and no global property with this name contains a value.
1090 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
1091 __ ret(0);
1092
1093 // Return the generated code.
1094 return GetCode(kind(), Code::FAST, name);
1095 }
1096
1097
1098 Register* PropertyAccessCompiler::load_calling_convention() { 1072 Register* PropertyAccessCompiler::load_calling_convention() {
1099 // receiver, name, scratch1, scratch2, scratch3, scratch4. 1073 // receiver, name, scratch1, scratch2, scratch3, scratch4.
1100 Register receiver = LoadIC::ReceiverRegister(); 1074 Register receiver = LoadIC::ReceiverRegister();
1101 Register name = LoadIC::NameRegister(); 1075 Register name = LoadIC::NameRegister();
1102 static Register registers[] = { receiver, name, rax, rbx, rdi, r8 }; 1076 static Register registers[] = { receiver, name, rax, rbx, rdi, r8 };
1103 return registers; 1077 return registers;
1104 } 1078 }
1105 1079
1106 1080
1107 Register* PropertyAccessCompiler::store_calling_convention() { 1081 Register* PropertyAccessCompiler::store_calling_convention() {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 // ----------------------------------- 1267 // -----------------------------------
1294 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1268 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1295 } 1269 }
1296 1270
1297 1271
1298 #undef __ 1272 #undef __
1299 1273
1300 } } // namespace v8::internal 1274 } } // namespace v8::internal
1301 1275
1302 #endif // V8_TARGET_ARCH_X64 1276 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | src/x87/stub-cache-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698