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/ast.cc

Issue 19485008: Replace CONSTANT_FUNCTION by CONSTANT (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 5 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/arm/stub-cache-arm.cc ('k') | src/bootstrapper.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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 LookupResult lookup(type->GetIsolate()); 558 LookupResult lookup(type->GetIsolate());
559 while (true) { 559 while (true) {
560 // If a dictionary map is found in the prototype chain before the actual 560 // If a dictionary map is found in the prototype chain before the actual
561 // target, a new target can always appear. In that case, bail out. 561 // target, a new target can always appear. In that case, bail out.
562 // TODO(verwaest): Alternatively a runtime negative lookup on the normal 562 // TODO(verwaest): Alternatively a runtime negative lookup on the normal
563 // receiver or prototype could be added. 563 // receiver or prototype could be added.
564 if (type->is_dictionary_map()) return false; 564 if (type->is_dictionary_map()) return false;
565 type->LookupDescriptor(NULL, *name, &lookup); 565 type->LookupDescriptor(NULL, *name, &lookup);
566 if (lookup.IsFound()) { 566 if (lookup.IsFound()) {
567 switch (lookup.type()) { 567 switch (lookup.type()) {
568 case CONSTANT_FUNCTION: 568 case CONSTANT: {
569 // We surely know the target for a constant function. 569 // We surely know the target for a constant function.
570 target_ = 570 Handle<Object> constant(lookup.GetConstantFromMap(*type),
571 Handle<JSFunction>(lookup.GetConstantFunctionFromMap(*type)); 571 type->GetIsolate());
572 return true; 572 if (constant->IsJSFunction()) {
573 target_ = Handle<JSFunction>::cast(constant);
574 return true;
575 }
576 // Fall through.
577 }
573 case NORMAL: 578 case NORMAL:
574 case FIELD: 579 case FIELD:
575 case CALLBACKS: 580 case CALLBACKS:
576 case HANDLER: 581 case HANDLER:
577 case INTERCEPTOR: 582 case INTERCEPTOR:
578 // We don't know the target. 583 // We don't know the target.
579 return false; 584 return false;
580 case TRANSITION: 585 case TRANSITION:
581 case NONEXISTENT: 586 case NONEXISTENT:
582 UNREACHABLE(); 587 UNREACHABLE();
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); 1200 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value());
1196 str = arr; 1201 str = arr;
1197 } else { 1202 } else {
1198 str = DoubleToCString(value_->Number(), buffer); 1203 str = DoubleToCString(value_->Number(), buffer);
1199 } 1204 }
1200 return factory->NewStringFromAscii(CStrVector(str)); 1205 return factory->NewStringFromAscii(CStrVector(str));
1201 } 1206 }
1202 1207
1203 1208
1204 } } // namespace v8::internal 1209 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698