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

Side by Side Diff: src/ast.cc

Issue 12700006: Replace ICStub for array.length with hydrogen stub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed debug print Created 7 years, 9 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/ast.h ('k') | src/code-stubs.h » ('j') | src/hydrogen.cc » ('J')
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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle, 407 void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle,
408 Zone* zone) { 408 Zone* zone) {
409 // Record type feedback from the oracle in the AST. 409 // Record type feedback from the oracle in the AST.
410 is_uninitialized_ = oracle->LoadIsUninitialized(this); 410 is_uninitialized_ = oracle->LoadIsUninitialized(this);
411 if (is_uninitialized_) return; 411 if (is_uninitialized_) return;
412 412
413 is_monomorphic_ = oracle->LoadIsMonomorphicNormal(this); 413 is_monomorphic_ = oracle->LoadIsMonomorphicNormal(this);
414 receiver_types_.Clear(); 414 receiver_types_.Clear();
415 if (key()->IsPropertyName()) { 415 if (key()->IsPropertyName()) {
416 ArrayLengthStub array_stub(Code::LOAD_IC);
417 FunctionPrototypeStub proto_stub(Code::LOAD_IC); 416 FunctionPrototypeStub proto_stub(Code::LOAD_IC);
418 StringLengthStub string_stub(Code::LOAD_IC, false); 417 StringLengthStub string_stub(Code::LOAD_IC, false);
419 if (oracle->LoadIsStub(this, &array_stub)) { 418 if (oracle->LoadIsStub(this, &string_stub)) {
420 is_array_length_ = true;
421 } else if (oracle->LoadIsStub(this, &string_stub)) {
422 is_string_length_ = true; 419 is_string_length_ = true;
423 } else if (oracle->LoadIsStub(this, &proto_stub)) { 420 } else if (oracle->LoadIsStub(this, &proto_stub)) {
424 is_function_prototype_ = true; 421 is_function_prototype_ = true;
425 } else { 422 } else {
426 Literal* lit_key = key()->AsLiteral(); 423 Literal* lit_key = key()->AsLiteral();
427 ASSERT(lit_key != NULL && lit_key->handle()->IsString()); 424 ASSERT(lit_key != NULL && lit_key->handle()->IsString());
428 Handle<String> name = Handle<String>::cast(lit_key->handle()); 425 Handle<String> name = Handle<String>::cast(lit_key->handle());
429 oracle->LoadReceiverTypes(this, name, &receiver_types_); 426 oracle->LoadReceiverTypes(this, name, &receiver_types_);
430 } 427 }
431 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) { 428 } else if (oracle->LoadIsBuiltin(this, Builtins::kKeyedLoadIC_String)) {
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value()); 1105 OS::SNPrintF(buffer, "%d", Smi::cast(*handle_)->value());
1109 str = arr; 1106 str = arr;
1110 } else { 1107 } else {
1111 str = DoubleToCString(handle_->Number(), buffer); 1108 str = DoubleToCString(handle_->Number(), buffer);
1112 } 1109 }
1113 return FACTORY->NewStringFromAscii(CStrVector(str)); 1110 return FACTORY->NewStringFromAscii(CStrVector(str));
1114 } 1111 }
1115 1112
1116 1113
1117 } } // namespace v8::internal 1114 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/code-stubs.h » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698