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

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

Issue 458813002: Prototype implementation of GET_OWN_PROPERTY intrinsic. (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/hydrogen-instructions.h ('k') | src/ia32/ic-ia32.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_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 __ RecordWriteField(eax, JSGeneratorObject::kResultValuePropertyOffset, 2214 __ RecordWriteField(eax, JSGeneratorObject::kResultValuePropertyOffset,
2215 ecx, edx, kDontSaveFPRegs); 2215 ecx, edx, kDontSaveFPRegs);
2216 } 2216 }
2217 2217
2218 2218
2219 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 2219 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
2220 SetSourcePosition(prop->position()); 2220 SetSourcePosition(prop->position());
2221 Literal* key = prop->key()->AsLiteral(); 2221 Literal* key = prop->key()->AsLiteral();
2222 DCHECK(!key->value()->IsSmi()); 2222 DCHECK(!key->value()->IsSmi());
2223 __ mov(LoadIC::NameRegister(), Immediate(key->value())); 2223 __ mov(LoadIC::NameRegister(), Immediate(key->value()));
2224 LoadIC::PropertyLookupMode property_lookup_mode =
2225 prop->IsOwnProperty()
2226 ? LoadIC::OWN_PROPERTY_LOOKUP
2227 : LoadIC::NORMAL_LOOKUP;
2228
2229 if (key->IsPropertyName() && (strcmp("xBase", key->AsPropertyName()->ToCString ().get()) == 0)) {
2230 printf("EmitNamedPropertyLoad:");
2231 key->AsPropertyName()->Print();
2232 printf(" property_lookup_mode = %d\n", property_lookup_mode);
2233 }
2224 if (FLAG_vector_ics) { 2234 if (FLAG_vector_ics) {
2225 __ mov(LoadIC::SlotRegister(), 2235 __ mov(LoadIC::SlotRegister(),
2226 Immediate(Smi::FromInt(prop->PropertyFeedbackSlot()))); 2236 Immediate(Smi::FromInt(prop->PropertyFeedbackSlot())));
2227 CallLoadIC(NOT_CONTEXTUAL); 2237 CallLoadIC(NOT_CONTEXTUAL, property_lookup_mode);
2228 } else { 2238 } else {
2229 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); 2239 CallLoadIC(NOT_CONTEXTUAL,
2240 property_lookup_mode,
2241 prop->PropertyFeedbackId());
2230 } 2242 }
2231 } 2243 }
2232 2244
2233 2245
2234 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2246 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2235 SetSourcePosition(prop->position()); 2247 SetSourcePosition(prop->position());
2236 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 2248
2249 LoadIC::PropertyLookupMode property_lookup_mode =
2250 prop->IsOwnProperty()
2251 ? LoadIC::OWN_PROPERTY_LOOKUP
2252 : LoadIC::NORMAL_LOOKUP;
2253
2237 if (FLAG_vector_ics) { 2254 if (FLAG_vector_ics) {
2238 __ mov(LoadIC::SlotRegister(), 2255 __ mov(LoadIC::SlotRegister(),
2239 Immediate(Smi::FromInt(prop->PropertyFeedbackSlot()))); 2256 Immediate(Smi::FromInt(prop->PropertyFeedbackSlot())));
2240 CallIC(ic); 2257 CallKeyedLoadIC(property_lookup_mode);
2241 } else { 2258 } else {
2242 CallIC(ic, prop->PropertyFeedbackId()); 2259 CallKeyedLoadIC(property_lookup_mode, prop->PropertyFeedbackId());
2243 } 2260 }
2244 } 2261 }
2245 2262
2246 2263
2247 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 2264 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2248 Token::Value op, 2265 Token::Value op,
2249 OverwriteMode mode, 2266 OverwriteMode mode,
2250 Expression* left, 2267 Expression* left,
2251 Expression* right) { 2268 Expression* right) {
2252 // Do combined smi check of the operands. Left operand is on the 2269 // Do combined smi check of the operands. Left operand is on the
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after
4043 // Push the builtins object as receiver. 4060 // Push the builtins object as receiver.
4044 __ mov(eax, GlobalObjectOperand()); 4061 __ mov(eax, GlobalObjectOperand());
4045 __ push(FieldOperand(eax, GlobalObject::kBuiltinsOffset)); 4062 __ push(FieldOperand(eax, GlobalObject::kBuiltinsOffset));
4046 4063
4047 // Load the function from the receiver. 4064 // Load the function from the receiver.
4048 __ mov(LoadIC::ReceiverRegister(), Operand(esp, 0)); 4065 __ mov(LoadIC::ReceiverRegister(), Operand(esp, 0));
4049 __ mov(LoadIC::NameRegister(), Immediate(expr->name())); 4066 __ mov(LoadIC::NameRegister(), Immediate(expr->name()));
4050 if (FLAG_vector_ics) { 4067 if (FLAG_vector_ics) {
4051 __ mov(LoadIC::SlotRegister(), 4068 __ mov(LoadIC::SlotRegister(),
4052 Immediate(Smi::FromInt(expr->CallRuntimeFeedbackSlot()))); 4069 Immediate(Smi::FromInt(expr->CallRuntimeFeedbackSlot())));
4053 CallLoadIC(NOT_CONTEXTUAL); 4070 CallLoadIC(NOT_CONTEXTUAL, LoadIC::NORMAL_LOOKUP);
4054 } else { 4071 } else {
4055 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); 4072 CallLoadIC(NOT_CONTEXTUAL, LoadIC::NORMAL_LOOKUP, expr->CallRuntimeFeedbac kId());
4056 } 4073 }
4057 4074
4058 // Push the target function under the receiver. 4075 // Push the target function under the receiver.
4059 __ push(Operand(esp, 0)); 4076 __ push(Operand(esp, 0));
4060 __ mov(Operand(esp, kPointerSize), eax); 4077 __ mov(Operand(esp, kPointerSize), eax);
4061 4078
4062 // Code common for calls using the IC. 4079 // Code common for calls using the IC.
4063 ZoneList<Expression*>* args = expr->arguments(); 4080 ZoneList<Expression*>* args = expr->arguments();
4064 int arg_count = args->length(); 4081 int arg_count = args->length();
4065 for (int i = 0; i < arg_count; i++) { 4082 for (int i = 0; i < arg_count; i++) {
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
4825 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 4842 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
4826 Assembler::target_address_at(call_target_address, 4843 Assembler::target_address_at(call_target_address,
4827 unoptimized_code)); 4844 unoptimized_code));
4828 return OSR_AFTER_STACK_CHECK; 4845 return OSR_AFTER_STACK_CHECK;
4829 } 4846 }
4830 4847
4831 4848
4832 } } // namespace v8::internal 4849 } } // namespace v8::internal
4833 4850
4834 #endif // V8_TARGET_ARCH_IA32 4851 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698