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

Side by Side Diff: src/hydrogen.cc

Issue 212603014: Inline internal getters for typed arrays & friends. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix ApiObjectGroupsCycleForScavenger test Created 6 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/arraybuffer.js ('k') | src/hydrogen-instructions.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 8712 matching lines...) Expand 10 before | Expand all | Expand 10 after
8723 8723
8724 void HOptimizedGraphBuilder::GenerateTypedArrayMaxSizeInHeap( 8724 void HOptimizedGraphBuilder::GenerateTypedArrayMaxSizeInHeap(
8725 CallRuntime* expr) { 8725 CallRuntime* expr) {
8726 ASSERT(expr->arguments()->length() == 0); 8726 ASSERT(expr->arguments()->length() == 0);
8727 HConstant* result = New<HConstant>(static_cast<int32_t>( 8727 HConstant* result = New<HConstant>(static_cast<int32_t>(
8728 FLAG_typed_array_max_size_in_heap)); 8728 FLAG_typed_array_max_size_in_heap));
8729 return ast_context()->ReturnInstruction(result, expr->id()); 8729 return ast_context()->ReturnInstruction(result, expr->id());
8730 } 8730 }
8731 8731
8732 8732
8733 void HOptimizedGraphBuilder::GenerateArrayBufferGetByteLength(
8734 CallRuntime* expr) {
8735 ASSERT(expr->arguments()->length() == 1);
8736 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
8737 HValue* buffer = Pop();
8738 HInstruction* result = New<HLoadNamedField>(
8739 buffer,
8740 static_cast<HValue*>(NULL),
8741 HObjectAccess::ForJSArrayBufferByteLength());
8742 return ast_context()->ReturnInstruction(result, expr->id());
8743 }
8744
8745
8746 void HOptimizedGraphBuilder::GenerateArrayBufferViewGetByteLength(
8747 CallRuntime* expr) {
8748 ASSERT(expr->arguments()->length() == 1);
8749 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
8750 HValue* buffer = Pop();
8751 HInstruction* result = New<HLoadNamedField>(
8752 buffer,
8753 static_cast<HValue*>(NULL),
8754 HObjectAccess::ForJSArrayBufferViewByteLength());
8755 return ast_context()->ReturnInstruction(result, expr->id());
8756 }
8757
8758
8759 void HOptimizedGraphBuilder::GenerateArrayBufferViewGetByteOffset(
8760 CallRuntime* expr) {
8761 ASSERT(expr->arguments()->length() == 1);
8762 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
8763 HValue* buffer = Pop();
8764 HInstruction* result = New<HLoadNamedField>(
8765 buffer,
8766 static_cast<HValue*>(NULL),
8767 HObjectAccess::ForJSArrayBufferViewByteOffset());
8768 return ast_context()->ReturnInstruction(result, expr->id());
8769 }
8770
8771
8772 void HOptimizedGraphBuilder::GenerateTypedArrayGetLength(
8773 CallRuntime* expr) {
8774 ASSERT(expr->arguments()->length() == 1);
8775 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
8776 HValue* buffer = Pop();
8777 HInstruction* result = New<HLoadNamedField>(
8778 buffer,
8779 static_cast<HValue*>(NULL),
8780 HObjectAccess::ForJSTypedArrayLength());
8781 return ast_context()->ReturnInstruction(result, expr->id());
8782 }
8783
8784
8733 void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) { 8785 void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) {
8734 ASSERT(!HasStackOverflow()); 8786 ASSERT(!HasStackOverflow());
8735 ASSERT(current_block() != NULL); 8787 ASSERT(current_block() != NULL);
8736 ASSERT(current_block()->HasPredecessor()); 8788 ASSERT(current_block()->HasPredecessor());
8737 if (expr->is_jsruntime()) { 8789 if (expr->is_jsruntime()) {
8738 return Bailout(kCallToAJavaScriptRuntimeFunction); 8790 return Bailout(kCallToAJavaScriptRuntimeFunction);
8739 } 8791 }
8740 8792
8741 const Runtime::Function* function = expr->function(); 8793 const Runtime::Function* function = expr->function();
8742 ASSERT(function != NULL); 8794 ASSERT(function != NULL);
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after
11448 if (ShouldProduceTraceOutput()) { 11500 if (ShouldProduceTraceOutput()) {
11449 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11501 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11450 } 11502 }
11451 11503
11452 #ifdef DEBUG 11504 #ifdef DEBUG
11453 graph_->Verify(false); // No full verify. 11505 graph_->Verify(false); // No full verify.
11454 #endif 11506 #endif
11455 } 11507 }
11456 11508
11457 } } // namespace v8::internal 11509 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arraybuffer.js ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698