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

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

Issue 14847004: Turn the load field code stub into a hydrogen code stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 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
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/x64/code-stubs-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 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 JSObject::UpdateMapCodeCache(receiver, cache_name, handler); 216 JSObject::UpdateMapCodeCache(receiver, cache_name, handler);
217 return handler; 217 return handler;
218 } 218 }
219 219
220 220
221 Handle<Code> StubCache::ComputeLoadField(Handle<Name> name, 221 Handle<Code> StubCache::ComputeLoadField(Handle<Name> name,
222 Handle<JSObject> receiver, 222 Handle<JSObject> receiver,
223 Handle<JSObject> holder, 223 Handle<JSObject> holder,
224 PropertyIndex field) { 224 PropertyIndex field) {
225 if (receiver.is_identical_to(holder)) { 225 if (receiver.is_identical_to(holder)) {
226 LoadFieldStub stub(LoadStubCompiler::receiver(), 226 LoadFieldStub stub(field.is_inobject(holder),
227 field.is_inobject(holder),
228 field.translate(holder)); 227 field.translate(holder));
229 return stub.GetCode(isolate()); 228 return stub.GetCode(isolate());
230 } 229 }
231 230
232 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 231 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
233 Handle<Code> stub = FindHandler( 232 Handle<Code> stub = FindHandler(
234 name, receiver, stub_holder, Code::LOAD_IC, Code::FIELD); 233 name, receiver, stub_holder, Code::LOAD_IC, Code::FIELD);
235 if (!stub.is_null()) return stub; 234 if (!stub.is_null()) return stub;
236 235
237 LoadStubCompiler compiler(isolate_); 236 LoadStubCompiler compiler(isolate_);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 JSObject::UpdateMapCodeCache(stub_holder, name, ic); 331 JSObject::UpdateMapCodeCache(stub_holder, name, ic);
333 return ic; 332 return ic;
334 } 333 }
335 334
336 335
337 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<Name> name, 336 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<Name> name,
338 Handle<JSObject> receiver, 337 Handle<JSObject> receiver,
339 Handle<JSObject> holder, 338 Handle<JSObject> holder,
340 PropertyIndex field) { 339 PropertyIndex field) {
341 if (receiver.is_identical_to(holder)) { 340 if (receiver.is_identical_to(holder)) {
342 LoadFieldStub stub(KeyedLoadStubCompiler::receiver(), 341 KeyedLoadFieldStub stub(field.is_inobject(holder),
343 field.is_inobject(holder), 342 field.translate(holder));
344 field.translate(holder));
345 return stub.GetCode(isolate()); 343 return stub.GetCode(isolate());
346 } 344 }
347 345
348 Handle<JSObject> stub_holder = StubHolder(receiver, holder); 346 Handle<JSObject> stub_holder = StubHolder(receiver, holder);
349 Handle<Code> stub = FindHandler( 347 Handle<Code> stub = FindHandler(
350 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::FIELD); 348 name, receiver, stub_holder, Code::KEYED_LOAD_IC, Code::FIELD);
351 if (!stub.is_null()) return stub; 349 if (!stub.is_null()) return stub;
352 350
353 KeyedLoadStubCompiler compiler(isolate_); 351 KeyedLoadStubCompiler compiler(isolate_);
354 Handle<Code> handler = 352 Handle<Code> handler =
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 1516
1519 1517
1520 Handle<Code> BaseLoadStubCompiler::CompileLoadField(Handle<JSObject> object, 1518 Handle<Code> BaseLoadStubCompiler::CompileLoadField(Handle<JSObject> object,
1521 Handle<JSObject> holder, 1519 Handle<JSObject> holder,
1522 Handle<Name> name, 1520 Handle<Name> name,
1523 PropertyIndex field) { 1521 PropertyIndex field) {
1524 Label miss; 1522 Label miss;
1525 1523
1526 Register reg = HandlerFrontendHeader(object, receiver(), holder, name, &miss); 1524 Register reg = HandlerFrontendHeader(object, receiver(), holder, name, &miss);
1527 1525
1528 LoadFieldStub stub(reg, field.is_inobject(holder), field.translate(holder)); 1526 GenerateLoadField(reg, holder, field);
1529 GenerateTailCall(masm(), stub.GetCode(isolate()));
1530 1527
1531 __ bind(&miss); 1528 __ bind(&miss);
1532 TailCallBuiltin(masm(), MissBuiltin(kind())); 1529 TailCallBuiltin(masm(), MissBuiltin(kind()));
1533 1530
1534 // Return the generated code. 1531 // Return the generated code.
1535 return GetCode(kind(), Code::FIELD, name); 1532 return GetCode(kind(), Code::FIELD, name);
1536 } 1533 }
1537 1534
1538 1535
1539 // Load a fast property out of a holder object (src). In-object properties 1536 // Load a fast property out of a holder object (src). In-object properties
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 void BaseLoadStubCompiler::GenerateLoadPostInterceptor( 1601 void BaseLoadStubCompiler::GenerateLoadPostInterceptor(
1605 Register interceptor_reg, 1602 Register interceptor_reg,
1606 Handle<JSObject> interceptor_holder, 1603 Handle<JSObject> interceptor_holder,
1607 Handle<Name> name, 1604 Handle<Name> name,
1608 LookupResult* lookup) { 1605 LookupResult* lookup) {
1609 Label success; 1606 Label success;
1610 Handle<JSObject> holder(lookup->holder()); 1607 Handle<JSObject> holder(lookup->holder());
1611 if (lookup->IsField()) { 1608 if (lookup->IsField()) {
1612 PropertyIndex field = lookup->GetFieldIndex(); 1609 PropertyIndex field = lookup->GetFieldIndex();
1613 if (interceptor_holder.is_identical_to(holder)) { 1610 if (interceptor_holder.is_identical_to(holder)) {
1614 LoadFieldStub stub(interceptor_reg, 1611 GenerateLoadField(interceptor_reg, holder, field);
1615 field.is_inobject(holder),
1616 field.translate(holder));
1617 GenerateTailCall(masm(), stub.GetCode(isolate()));
1618 } else { 1612 } else {
1619 // We found FIELD property in prototype chain of interceptor's holder. 1613 // We found FIELD property in prototype chain of interceptor's holder.
1620 // Retrieve a field from field's holder. 1614 // Retrieve a field from field's holder.
1621 Register reg = HandlerFrontend( 1615 Register reg = HandlerFrontend(
1622 interceptor_holder, interceptor_reg, holder, name, &success); 1616 interceptor_holder, interceptor_reg, holder, name, &success);
1623 __ bind(&success); 1617 __ bind(&success);
1624 GenerateLoadField(reg, holder, field); 1618 GenerateLoadField(reg, holder, field);
1625 } 1619 }
1626 } else { 1620 } else {
1627 // We found CALLBACKS property in prototype chain of interceptor's 1621 // We found CALLBACKS property in prototype chain of interceptor's
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 Handle<FunctionTemplateInfo>( 2110 Handle<FunctionTemplateInfo>(
2117 FunctionTemplateInfo::cast(signature->receiver())); 2111 FunctionTemplateInfo::cast(signature->receiver()));
2118 } 2112 }
2119 } 2113 }
2120 2114
2121 is_simple_api_call_ = true; 2115 is_simple_api_call_ = true;
2122 } 2116 }
2123 2117
2124 2118
2125 } } // namespace v8::internal 2119 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698